summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-05-07 13:31:51 -0400
committerKevin Newton <kddnewton@gmail.com>2024-05-07 14:24:31 -0400
commitb4b39a619984bbb3c96406a1eb4dfb477168a1cd (patch)
tree32d38c64a772d8beed810cb79e93744b4411f6f7 /tool/lib
parent2bfc48755e7fc39e1ee33181a4bd6b72aa27de48 (diff)
[PRISM] Enable test_methoddef_endless_command
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit/assertions.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index b4f1dbc176..aad422f7e7 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -768,7 +768,14 @@ EOT
e = assert_raise(SyntaxError, mesg) do
syntax_check(src, fname, line)
end
- assert_match(error, e.message, mesg)
+
+ # Prism adds ANSI escape sequences to syntax error messages to
+ # colorize and format them. We strip them out here to make them easier
+ # to match against in tests.
+ message = e.message
+ message.gsub!(/\e\[.*?m/, "")
+
+ assert_match(error, message, mesg)
e
end
end