diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_proc.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 701bd078ca..69cb0e439b 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -1390,4 +1390,22 @@ class TestProc < Test::Unit::TestCase e.each {} EOS end + + def test_prepended_call + assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", ["call"]) + begin; + Proc.prepend Module.new {def call() puts "call"; super; end} + def m(&blk) blk.call; end + m {} + end; + end + + def test_refined_call + assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", ["call"]) + begin; + using Module.new {refine(Proc) {def call() puts "call"; super; end}} + def m(&blk) blk.call; end + m {} + end; + end end |