Permalink
Browse files

Add spec for curried proc passed to instance_exec.

  • Loading branch information...
1 parent 9288335 commit d69269042b7c2cd461ef80d3e38b70abafb97147 @headius headius committed Oct 23, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 spec/ruby/core/proc/curry_spec.rb
View
6 spec/ruby/core/proc/curry_spec.rb
@@ -74,6 +74,12 @@
it "produces Procs that return nil for #source_location" do
@proc_add.curry.source_location.should == nil
end
+
+ it "produces Procs that can be passed as the block for instance_exec" do
+ curried = @proc_add.curry.call(1, 2)
+
+ instance_exec(3, &curried).should == 6
+ end
end
describe "Proc#curry with arity argument" do

0 comments on commit d692690

Please sign in to comment.