diff options
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 14990be12c..f0f872013d 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -825,4 +825,18 @@ x = __ENCODING__ c.instance_eval { remove_class_variable(:@var) } end end + + def test_method_block_location + bug5614 = '[ruby-core:40936]' + expected = nil + e = assert_raise(NoMethodError) do + 1.times do + expected = __LINE__+1 + end.print do + # + end + end + actual = e.backtrace.first[/\A#{Regexp.quote(__FILE__)}:(\d+):/o, 1].to_i + assert_equal(expected, actual, bug5614) + end end |