Skip to content

Commit 52943c9

Browse files
cboosmame
authored andcommitted
Reproduce the error seen when calling .to_s in embedded Ruby
The test fails with the following error: Error: test_simulate_funcallv_from_embedded_ruby(ErrorHighlightTest): TypeError: wrong argument type nil (expected method)
1 parent ae30536 commit 52943c9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test_error_highlight.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,4 +1194,20 @@ def test_no_final_newline
11941194
end
11951195
end
11961196
end
1197+
1198+
def test_simulate_funcallv_from_embedded_ruby
1199+
assert_error_message(NoMethodError, <<~END) do
1200+
undefined method `foo' for nil:NilClass
1201+
1202+
nil.foo + 1
1203+
^^^^
1204+
END
1205+
1206+
nil.foo + 1
1207+
rescue NoMethodError => exc
1208+
def exc.backtrace_locations = []
1209+
raise
1210+
end
1211+
end
1212+
11971213
end

0 commit comments

Comments
 (0)