Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Spec for binding's self within an instance_exec.

  • Loading branch information...
commit 8f85e29fde86321c93106f1a58ef608c1abfe910 1 parent 67d8df4
@headius headius authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 core/object/instance_exec_spec.rb
View
5 core/object/instance_exec_spec.rb
@@ -44,6 +44,11 @@ def foo
s = "hola"
(s == s.instance_exec { self }).should == true
end
+
+ it "binds the block's binding self to the receiver" do
+ s = "hola"
+ (s == s.instance_exec { eval "self", binding }).should == true
+ end
it "executes in the context of the receiver" do
"Ruby-fu".instance_exec { size }.should == 7
Please sign in to comment.
Something went wrong with that request. Please try again.