From 3dbd703511ff5207eeed5adc74989fb2c94cc698 Mon Sep 17 00:00:00 2001
From: Bernd Ohr <jazzbox@7zz.de>
Date: Thu, 15 Oct 2009 14:30:42 +0200
Subject: [PATCH] add failing tests: binding with block
---
test_vm/eval.rb | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/test_vm/eval.rb b/test_vm/eval.rb
index 95c581b..85aa271 100644
|
a
|
b
|
|
| 118 | 118 | rescue Exception => e |
| 119 | 119 | end |
| 120 | 120 | p e.backtrace.kind_of? Array |
| 121 | | } |
| 122 | | No newline at end of file |
| | 121 | } |
| | 122 | |
| | 123 | assert 'true', %{ |
| | 124 | class Foo |
| | 125 | def get_binding |
| | 126 | binding |
| | 127 | end |
| | 128 | end |
| | 129 | b = Foo.new.get_binding { 42 } |
| | 130 | p eval "block_given?", b |
| | 131 | } |
| | 132 | |
| | 133 | assert '42', %{ |
| | 134 | class Foo |
| | 135 | def get_binding |
| | 136 | binding |
| | 137 | end |
| | 138 | end |
| | 139 | b = Foo.new.get_binding { 42 } |
| | 140 | p eval "yield", b |
| | 141 | } |
| | 142 | |