1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/error_highlight] 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)

https://github.com/ruby/error_highlight/commit/52943c9cd2
This commit is contained in:
Christian Boos 2021-12-29 22:03:41 +00:00 committed by git
parent b673e9a304
commit e22218b510

View file

@ -1194,4 +1194,20 @@ undefined method `time' for 1:Integer
end
end
end
def test_simulate_funcallv_from_embedded_ruby
assert_error_message(NoMethodError, <<~END) do
undefined method `foo' for nil:NilClass
nil.foo + 1
^^^^
END
nil.foo + 1
rescue NoMethodError => exc
def exc.backtrace_locations = []
raise
end
end
end