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

when $VERBOSE is enabled prints no warnings fails because of Source locally installed gems is ignoring message #888

Open
yahonda opened this issue Oct 30, 2024 · 1 comment

Comments

@yahonda
Copy link
Member

yahonda commented Oct 30, 2024

Steps to reproduce

  1. Install Ruby 3.4.0dev
  2. Run these commands
git clone https://github.com/rails/thor
cd thor
bundle install
bundle exec rspec ./spec/no_warnings_spec.rb:4

Expected behavior

It should pass.

Actual behavior

It fails as follows.

$ ruby -v
ruby 3.4.0dev (2024-10-26T13:20:34Z master 484ea00d2e) +PRISM [x86_64-linux]
$ bundle exec rspec ./spec/no_warnings_spec.rb:4
Source locally installed gems is ignoring #<Bundler::StubSpecification name=prism version=1.0.0 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=json version=2.7.2 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=google-protobuf version=4.27.0 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=cgi version=0.4.1 platform=ruby> because it is missing extensions
Run options: include {locations: {"./spec/no_warnings_spec.rb" => [4]}}
F

Failures:

  1) when $VERBOSE is enabled prints no warnings
     Failure/Error: expect(err).to be_empty
       expected `"Source locally installed gems is ignoring #<Bundler::StubSpecification name=prism version=1.0.0 plat...Bundler::StubSpecification name=cgi version=0.4.1 platform=ruby> because it is missing extensions\n".empty?` to be truthy, got false
     # ./spec/no_warnings_spec.rb:8:in 'block (2 levels) in <top (required)>'

Finished in 0.16809 seconds (files took 0.05484 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/no_warnings_spec.rb:4 # when $VERBOSE is enabled prints no warnings

$
@yahonda
Copy link
Member Author

yahonda commented Oct 30, 2024

This spec fails because of the Source locally installed gems is ignoring message that is emitted by bundler.

_, err, = Open3.capture3("ruby -I #{root}/lib #{root}/spec/fixtures/verbose.thor")

  • Run the thor command of this spec with bundler, that emits Source locally installed gems is ignoring warnings.
$ bundle exec ruby -I ./lib/ ./spec/fixtures/verbose.thor
Source locally installed gems is ignoring #<Bundler::StubSpecification name=prism version=1.0.0 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=json version=2.7.2 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=google-protobuf version=4.27.0 platform=ruby> because it is missing extensions
Source locally installed gems is ignoring #<Bundler::StubSpecification name=cgi version=0.4.1 platform=ruby> because it is missing extensions
Commands:
  verbose.thor help [COMMAND]  # Describe available commands or one specific command

$
  • Run this spec without bundler, that does not emit any warnings.
$ ruby -I ./lib/ ./spec/fixtures/verbose.thor
Commands:
  verbose.thor help [COMMAND]  # Describe available commands or one specific command

$

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

No branches or pull requests

1 participant