diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_eval.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index a6900e075e..299165fb34 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -415,4 +415,19 @@ class TestEval < Test::Unit::TestCase assert_raise(ArgumentError) {eval("__ENCODING__".encode("utf-32be"))} assert_raise(ArgumentError) {eval("__ENCODING__".encode("utf-32le"))} end + + def test_instance_eval_method_proc + bug3860 = Class.new do + def initialize(a); + @a=a + end + def get(*args) + @a + end + end + foo = bug3860.new 1 + foo_pr = foo.method(:get).to_proc + result = foo.instance_eval(&foo_pr) + assert_equal(1, result, 'Bug #3786, Bug #3860, [ruby-core:32501]') + end end |