Skip to content

Fix a test for bin/bundle update --bundler to pass on ruby/ruby.#5410

Merged
simi merged 1 commit intoruby:masterfrom
junaruga:wip/bundler-latest-installed-bundler-test
Mar 22, 2022
Merged

Fix a test for bin/bundle update --bundler to pass on ruby/ruby.#5410
simi merged 1 commit intoruby:masterfrom
junaruga:wip/bundler-latest-installed-bundler-test

Conversation

@junaruga
Copy link
Copy Markdown
Member

@junaruga junaruga commented Mar 21, 2022

This change to relax the test is to pass make test-bundler on ruby/ruby,
where the system_bundler_version (= Bundler::VERSION) is not the latest version on the RubyGems.
See https://bugs.ruby-lang.org/issues/18643.

What was the end-user or developer problem that led to this PR?

The test can fail in make test-bundler (make test-bundler BUNDLER_SPECS="commands/binstubs_spec.rb") in ruby/ruby, where the Bundler::VERSION is not the latest version in RubyGems.

What is your fix for the problem, implemented in this PR?

I relaxed the matching criteria not depending on the version number.

I tried to use a regular expression seeing the RSpec include method document,
https://relishapp.com/rspec/rspec-expectations/v/3-10/docs/built-in-matchers/include-matcher

expect(out).to include %r(Using bundler \w+\n)

However I see there is a syntax error no implicit conversion of Regexp into String. So, I am just using a string matching.

Make sure the following tasks are checked

Comment thread bundler/spec/commands/binstubs_spec.rb Outdated
@junaruga junaruga force-pushed the wip/bundler-latest-installed-bundler-test branch 3 times, most recently from 56416e9 to 9c66ae2 Compare March 21, 2022 19:25
@junaruga
Copy link
Copy Markdown
Member Author

Rebased with the implementation to compare the Bundler version. The bin/rubocop on Ruby 3.1.1 shows an issue maybe coming from rubocop itself. Hope the rubocop test passes on CI.

$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]

$ bin/rubocop spec/commands/binstubs_spec.rb
Inspecting 1 file
An error occurred while Layout/BlockAlignment cop was inspecting /home/jaruga/var/git/rubygems/bundler/spec/commands/binstubs_spec.rb:3:0.
To see the complete backtrace run rubocop -d.
.

1 file inspected, no offenses detected

1 error occurred:
An error occurred while Layout/BlockAlignment cop was inspecting /home/jaruga/var/git/rubygems/bundler/spec/commands/binstubs_spec.rb:3:0.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop-hq/rubocop/issues

Mention the following information in the issue report:
0.80.1 (using Parser 3.1.0.0, running on ruby 3.1.1 x86_64-linux)

@junaruga junaruga changed the title Relax a test to test bin/bundle update --bundler to pass on ruby/ruby Fix a test for bin/bundle update --bundler to pass on ruby/ruby. Mar 21, 2022
Comment thread bundler/spec/commands/binstubs_spec.rb Outdated
Consider the case that the latest Bundler version on RubyGems is higher than
the `system_bundler_version` (= `Bundler::VERSION`) in `make test-bundler` on
ruby/ruby.

See <https://bugs.ruby-lang.org/issues/18643>.
@junaruga junaruga force-pushed the wip/bundler-latest-installed-bundler-test branch from 9c66ae2 to bfa2f72 Compare March 22, 2022 13:03
@simi simi merged commit 1ff9aac into ruby:master Mar 22, 2022
@junaruga junaruga deleted the wip/bundler-latest-installed-bundler-test branch March 22, 2022 16:07
deivid-rodriguez pushed a commit that referenced this pull request Mar 23, 2022
…undler-test

Fix a test for `bin/bundle update --bundler` to pass on ruby/ruby.

(cherry picked from commit 1ff9aac)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants