examples/rr/stub_creator_example.rb in rr-0.1.11 vs examples/rr/stub_creator_example.rb in rr-0.1.12
- old
+ new
@@ -19,10 +19,21 @@
it_should_behave_like "RR::StubCreator"
before do
@creator = StubCreator.new(@space, @subject)
end
+
+ it "clears out all methods from creator" do
+ creator_subclass = Class.new(StubCreator) do
+ def i_should_be_a_scenario
+ end
+ end
+ creator_subclass.instance_methods.should include('i_should_be_a_scenario')
+
+ creator = creator_subclass.new(@space, @subject)
+ creator.i_should_be_a_scenario.should be_instance_of(Scenario)
+ end
end
describe StubCreator, ".new with block" do
it_should_behave_like "RR::StubCreator"
@@ -42,9 +53,21 @@
@subject.foobar(1).should == :one
@subject.foobar(:something).should == :default
@subject.foobar(:something).should == :default
@subject.baz.should == :baz_result
@subject.baz.should == :baz_result
+ end
+
+ it "clears out all methods from creator" do
+ creator_subclass = Class.new(StubCreator) do
+ def i_should_be_a_scenario
+ end
+ end
+ creator_subclass.instance_methods.should include('i_should_be_a_scenario')
+
+ creator_subclass.new(@space, @subject) do |m|
+ m.i_should_be_a_scenario.should be_instance_of(Scenario)
+ end
end
end
describe StubCreator, "#method_missing" do
it_should_behave_like "RR::StubCreator"
\ No newline at end of file