Modified: MacRuby/branches/experimental/test_roxor.rb (1283 => 1284)
--- MacRuby/branches/experimental/test_roxor.rb 2009-03-31 21:01:08 UTC (rev 1283)
+++ MacRuby/branches/experimental/test_roxor.rb 2009-04-01 04:45:06 UTC (rev 1284)
@@ -1065,7 +1065,14 @@
assert '42', "x=42; 1.times { 1.times { 1.times { p x } } }"
assert '42', "def f; 1.times { yield 42 }; end; f {|x| p x}"
+
assert '42', "def foo; x = 42; proc { x }; end; p foo.call"
+ assert '42', %q{
+ def foo() x=1; [proc { x }, proc {|z| x = z}]; end
+ a, b = foo
+ b.call(42)
+ p a.call
+ }
end
@@ -1304,6 +1311,11 @@
p foo
}
+ assert '42', %q{
+ def foo; x = 42; proc {}; end
+ p = foo; eval('p x', p.binding)
+ }
+
assert "42", %q{
class Foo;
def foo; 42; end;