diff options
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index fd58ed5933..707a99f805 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -688,6 +688,16 @@ end.join assert_equal(:foo, e.name) assert_equal([1, 2], e.args) assert_same(obj, e.receiver) + def obj.test(a, b=nil, *c, &d) + e = a + 1.times {|f| g = foo} + end + e = assert_raise(NameError) { + obj.test(3) + } + assert_equal(:foo, e.name) + assert_same(obj, e.receiver) + assert_equal(%i[a b c d e f g], e.local_variables.sort) end def test_output_string_encoding |