-
Notifications
You must be signed in to change notification settings - Fork 597
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
Create helper to access Bundler.rubygems specs #2906
Conversation
Bundler version 2.5.12 deprecated all_specs and added installed_specs. To support newer Bundler versions, try to use installed_specs first, then fall back to all_specs. All callers expect this to be an array, so return an array if Bundler isn't defined. This consolidates the way the rubygems specs are accessed across the multiple places we use them.
end | ||
|
||
def test_rubygems_specs_works_with_all_specs_when_installed_specs_is_absent | ||
Bundler.rubygems.stub(:respond_to?, nil) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why, but Rubies 2.6 and below don't like the third argument for a stub in this scenario. However, they're fine with it in the test above. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that the older Rubies are given an older Minitest. Wanting to use 3 arguments was the primary reason for the introduction of our skip_unless_minitest5_or_above
helper.
SimpleCov Report
|
end | ||
|
||
def test_rubygems_specs_works_with_all_specs_when_installed_specs_is_absent | ||
Bundler.rubygems.stub(:respond_to?, nil) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that the older Rubies are given an older Minitest. Wanting to use 3 arguments was the primary reason for the introduction of our skip_unless_minitest5_or_above
helper.
Create helper to access Bundler.rubygems specs
This PR resolves a bug reported in #2885 to protect against scenarios where the version of Bundler used does not support
Bundler.rubygems.installed_specs
and needs to useBundler.rubygems.all_specs
to determine whether the third-party gem,newrelic-grape
is installed in the environment.Resolves #2885