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:
parent
b673e9a304
commit
e22218b510
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue