Skip to content

Commit 4b6abb7

Browse files
committed
Change assertion to not rely on exact text from prism
The original ripper test was very stable as the output didn't change. Prism is under active development and changing their output shouldn't cause a failure to the ruby/ruby test suite like https://github.com/ruby/ruby/actions/runs/7104601478/job/19339940315. This commit moves from checking exact output to asserting that the string we get back is not empty. This should give the same level of confidence that some error message was caught, and is less brittle.
1 parent 457c1eb commit 4b6abb7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

spec/unit/explain_syntax_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ module SyntaxSuggest
1414
).call
1515

1616
expect(explain.missing).to eq([])
17-
if SyntaxSuggest.use_prism_parser?
18-
expect(explain.errors.join).to include("Expected a closing delimiter for the interpolated string")
19-
else
20-
expect(explain.errors.join).to include("unterminated string")
21-
end
17+
expect(explain.errors.join.strip).to_not be_empty
2218
end
2319

2420
it "handles %w[]" do

0 commit comments

Comments
 (0)