[ruby/error_highlight] Make test_COLON2_5 conditional again

https://github.com/ruby/error_highlight/commit/da5e76bb06
This commit is contained in:
Yusuke Endoh 2024-07-12 15:10:20 +09:00 committed by git
parent 371055979f
commit bb1ef81732

View File

@ -869,13 +869,27 @@ uninitialized constant ErrorHighlightTest::NotDefined
end
end
def test_COLON2_5
# Unfortunately, we cannot identify which `NotDefined` caused the NameError
assert_error_message(NameError, <<~END) do
uninitialized constant ErrorHighlightTest::NotDefined
END
if ErrorHighlight.const_get(:Spotter).const_get(:OPT_GETCONSTANT_PATH)
def test_COLON2_5
# Unfortunately, we cannot identify which `NotDefined` caused the NameError
assert_error_message(NameError, <<~END) do
uninitialized constant ErrorHighlightTest::NotDefined
END
ErrorHighlightTest::NotDefined::NotDefined
ErrorHighlightTest::NotDefined::NotDefined
end
end
else
def test_COLON2_5
assert_error_message(NameError, <<~END) do
uninitialized constant ErrorHighlightTest::NotDefined
ErrorHighlightTest::NotDefined::NotDefined
^^^^^^^^^^^^
END
ErrorHighlightTest::NotDefined::NotDefined
end
end
end