зеркало из https://github.com/github/ruby.git
[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:
Родитель
b673e9a304
Коммит
e22218b510
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче