Permalink
Browse files

Plugging a leaky block scoped variable that Ruby 1.9 was more strict …

…about

Signed-off-by: Nick Quaranto <nick@quaran.to>
  • Loading branch information...
1 parent e8ce6b9 commit 452676dfc43928d50ccb3b9e825b5f1caa413feb @jasonm jasonm committed with qrush Jun 17, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 spec/factory_girl/syntax/generate_spec.rb
@@ -25,9 +25,9 @@
%w(generate generate! spawn).each do |method|
it "should yield a generated instance when using #{method} with a block" do
- instance = nil
- User.send(method) {|instance| }
- instance.should be_kind_of(User)
+ saved_instance = nil
+ User.send(method) {|instance| saved_instance = instance }
+ saved_instance.should be_kind_of(User)
end
describe "after generating an instance using #{method}" do

0 comments on commit 452676d

Please sign in to comment.