Skip to content

Commit

Permalink
Ensure the block called to Factory#run is actually called
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Oct 27, 2011
1 parent e3bf491 commit 4ede9f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/factory_girl/factory_spec.rb
Expand Up @@ -272,4 +272,12 @@
subject.run(FactoryGirl::Proxy::Build, { :name => "John Doe" })
proxy.should have_received(:set).once
end

it "calls the block and returns the result" do
block = proc { nil }
block.stubs(:call => "block result")

subject.run(FactoryGirl::Proxy::Build, { }, &block).should == "block result"
block.should have_received(:call).once
end
end

0 comments on commit 4ede9f1

Please sign in to comment.