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
Merged

Conversation

@BrianHawley
Copy link
Contributor

BrianHawley commented Jan 24, 2020

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]

@BrianHawley BrianHawley force-pushed the BrianHawley:fixes_399 branch from 79a65ee to 1545444 Jan 24, 2020
require 'ripper'
begin
# It doesn't matter if MRI compatibility is < 2.
Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0") ||

This comment has been minimized.

Copy link
@JonRowe

JonRowe Jan 24, 2020

Member

👋 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.

This comment has been minimized.

Copy link
@BrianHawley

BrianHawley Jan 24, 2020

Author Contributor

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 #399]
@BrianHawley BrianHawley force-pushed the BrianHawley:fixes_399 branch from 1545444 to 39de8fb Jan 24, 2020
@JonRowe JonRowe merged commit 57989b8 into rspec:master Jan 25, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@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 BrianHawley:fixes_399 branch Jan 25, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.