examples/rr/mock_creator_example.rb in rr-0.1.11 vs examples/rr/mock_creator_example.rb in rr-0.1.12

- old
+ new

@@ -19,10 +19,21 @@ it_should_behave_like "RR::MockCreator" before do @creator = MockCreator.new(@space, @subject) end + + it "clears out all methods from creator" do + creator_subclass = Class.new(MockCreator) 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 MockCreator, ".new with block" do it_should_behave_like "RR::MockCreator" @@ -38,9 +49,21 @@ it "creates doubles" do @subject.foobar(1, 2).should == :one_two @subject.foobar(1).should == :one @subject.foobar(:something).should == :default @subject.baz.should == :baz_result + end + + it "clears out all methods from creator" do + creator_subclass = Class.new(MockCreator) 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 MockCreator, "#method_missing" do \ No newline at end of file