Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename utility methods #reset and #verify to reset_rr and verify_rr to avoid clashes with other methods in Cucumber's World namespace #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rvm 1.9.2-p180@rr
rvm 1.9.2@rr
#rvm ree@rr
4 changes: 2 additions & 2 deletions lib/rr/adapters/rr_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def instance_of(subject=DoubleDefinitions::DoubleDefinitionCreate::NO_SUBJECT, m

# Verifies all the DoubleInjection objects have met their
# TimesCalledExpectations.
def verify
def verify_rr
RR::Space.instance.verify_doubles
end

# Resets the registered Doubles and ordered Doubles
def reset
def reset_rr
RR::Space.instance.reset
end

Expand Down
22 changes: 11 additions & 11 deletions spec/rr/adapters/rr_methods_space_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ module Adapters
@method_name = :foobar
end

describe "#verify" do
it "aliases #rr_verify" do
RRMethods.instance_method("verify").should == RRMethods.instance_method("rr_verify")
describe "#verify_rr" do
it "aliases #rr_verify_rr" do
RRMethods.instance_method("verify_rr").should == RRMethods.instance_method("rr_verify_rr")
end
end

describe "#rr_verify" do
describe "#rr_verify_rr" do
it "verifies and deletes the double_injections" do
double_1 = ::RR::Injections::DoubleInjection.find_or_create_by_subject(subject_1, method_name)
double_1_verify_calls = 0
Expand Down Expand Up @@ -46,28 +46,28 @@ class << double_1;
end
end

rr_verify
rr_verify_rr
double_1_verify_calls.should == 1
double_2_verify_calls.should == 1
double_1_reset_calls.should == 1
double_1_reset_calls.should == 1
end
end

describe "#reset" do
it "aliases #rr_reset" do
RRMethods.instance_method("reset").should == RRMethods.instance_method("rr_reset")
describe "#reset_rr" do
it "aliases #rr_reset_rr" do
RRMethods.instance_method("reset_rr").should == RRMethods.instance_method("rr_reset_rr")
end
end

describe "#rr_reset" do
describe "#rr_reset_rr" do
it "removes the ordered doubles" do
mock(subject_1).foobar1.ordered
mock(subject_2).foobar2.ordered

::RR::Injections::DoubleInjection.instances.should_not be_empty

rr_reset
rr_reset_rr
::RR::Injections::DoubleInjection.instances
::RR::Injections::DoubleInjection.instances.should be_empty
end
Expand All @@ -88,7 +88,7 @@ class << double_1;
end
end

rr_reset
rr_reset_rr
double_1_reset_calls.should == 1
double_2_reset_calls.should == 1
end
Expand Down