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

Don't raise exception on JRuby 9k < 9.2.1.0 #400

Merged
merged 1 commit into from Jan 25, 2020

Conversation

BrianHawley
Copy link
Contributor

JRuby 9k 9.2.0.0 and lower will has a bug in Ripper.sexp that raises a
NoMethodError when analyzing code that even references a method with
keyword arguments. This makes failure formatting raise that exception.
Best to just not use Ripper on JRuby 9k < 9.2.1.0.

[Fixes #399]

require 'ripper'
begin
# It doesn't matter if MRI compatibility is < 2.
Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0") ||
Copy link
Member

Choose a reason for hiding this comment

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

👋 You can't use Gem::Version within RSpec as we disable rubygems, I suspect this is why the build is failing. String comparison works fine for our purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'd already switched to string comparison before I saw your message, but it's good to know what went wrong.

JRuby 9k 9.2.0.0 and lower will has a bug in Ripper.sexp that raises a
NoMethodError when analyzing code that even references a method with
keyword arguments. This makes failure formatting raise that exception.
Best to just not use Ripper on JRuby 9k < 9.2.1.0.

[Fixes rspec#399]
@JonRowe JonRowe merged commit 57989b8 into rspec:master Jan 25, 2020
@JonRowe
Copy link
Member

JonRowe commented Jan 25, 2020

Thanks!

JonRowe added a commit that referenced this pull request Jan 25, 2020
@BrianHawley BrianHawley deleted the fixes_399 branch January 25, 2020 21:26
JonRowe added a commit that referenced this pull request May 2, 2020
Don't raise exception on JRuby 9k < 9.2.1.0
JonRowe added a commit that referenced this pull request May 2, 2020
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
…/fixes_399

Don't raise exception on JRuby 9k < 9.2.1.0

---
This commit was imported from rspec/rspec-support@d60a44d.
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
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.

Ripper formatting doesn't work on jruby-9.2.0.0
2 participants