Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with prism parser #53

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

@viralpraxis viralpraxis self-assigned this Sep 22, 2024
@viralpraxis viralpraxis marked this pull request as ready for review September 22, 2024 19:51
@@ -282,7 +282,7 @@ def some_method
it_behaves_like 'mutable objects', %("\#{a}")
end

context 'when the frozen_string_literal comment is true' do
context 'when the frozen_string_literal comment is true', unsupported_on: :prism do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make RSpec skip it on prism and let us know when it starts working because RSpec enforces pending specs must fail.

https://rspec.info/features/3-12/rspec-core/pending-and-skipped-examples/

Suggested change
context 'when the frozen_string_literal comment is true', unsupported_on: :prism do
context 'when the frozen_string_literal comment is true' do
pending 'Unsupported on prism' if ENV['PARSER_ENGINE'] == 'parser_prism'

We could consider extracting a helper:

def prism?
  ENV['PARSER_ENGINE'] == 'parser_prism'
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I didn't know about this feature. However, is this case it's not a prism-related issue, this spec only passes with Ruby 2.7 parser (dynamic strings are not frozen by default since 3.0), and while all the specs run with 2.7 parser, setting PARSER_ENGINE to parser_prism automatically promotes the parser to 3.3. So this spec will never pass on prism.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added specs for default parser that run at Ruby 3.0 (it now covers this line).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants