Skip to content

Commit

Permalink
Test the block is called in Factory#run
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Oct 27, 2011
1 parent 73b9e41 commit 93026a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/factory_girl/factory_spec.rb
Expand Up @@ -272,4 +272,11 @@
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_run = nil
block = lambda {|result| block_run = "changed" }
subject.run(FactoryGirl::Proxy::Build, { }, &block)
block_run.should == "changed"
end
end

0 comments on commit 93026a8

Please sign in to comment.