diff options
author | Schneems <richard.schneeman+foo@gmail.com> | 2023-12-05 12:24:06 -0600 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-12-05 18:25:42 +0000 |
commit | 82883dc8f2343913eb9df32fda6798b2f969dfee (patch) | |
tree | 7dac5a2da71bc41cd063adc3de943ad9e235e4ae /spec/syntax_suggest | |
parent | a063969ec18c8f213d9c70471a29d0d31ec5850a (diff) | |
download | ruby-82883dc8f2343913eb9df32fda6798b2f969dfee.tar.gz |
[ruby/syntax_suggest] 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.
https://github.com/ruby/syntax_suggest/commit/4b6abb763e
Diffstat (limited to 'spec/syntax_suggest')
-rw-r--r-- | spec/syntax_suggest/unit/explain_syntax_spec.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/spec/syntax_suggest/unit/explain_syntax_spec.rb b/spec/syntax_suggest/unit/explain_syntax_spec.rb index 76437bc740..c62a42b925 100644 --- a/spec/syntax_suggest/unit/explain_syntax_spec.rb +++ b/spec/syntax_suggest/unit/explain_syntax_spec.rb @@ -14,11 +14,7 @@ module SyntaxSuggest ).call expect(explain.missing).to eq([]) - if SyntaxSuggest.use_prism_parser? - expect(explain.errors.join).to include("Expected a closing delimiter for the interpolated string") - else - expect(explain.errors.join).to include("unterminated string") - end + expect(explain.errors.join.strip).to_not be_empty end it "handles %w[]" do |