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

RSpec warning #1686

Closed
qortex opened this issue Apr 3, 2020 · 3 comments
Closed

RSpec warning #1686

qortex opened this issue Apr 3, 2020 · 3 comments

Comments

@qortex
Copy link
Contributor

qortex commented Apr 3, 2020

Complete Description of Issue

When running RSpec specs on my projet, I get this warning when warnings are enabled:

/home/mic/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sequel-5.31.0/lib/sequel/dataset/query.rb:84: warning: statement not reached

Using Ruby 2.7.1.

@jeremyevans
Copy link
Owner

This is a verbose-mode warning, and expected due to an optimization that Sequel uses. If you want to ignore it:

require 'warning' # warning gem
Warning.ignore(:not_reached)

@qortex
Copy link
Contributor Author

qortex commented Apr 3, 2020

Got it, thanks!

@qortex
Copy link
Contributor Author

qortex commented Apr 29, 2020

Following up, this gem is amazing (as usual!). Thanks a lot.
Used:

Warning.ignore(:not_reached, /.*query\.rb/)

And useful to silence warnings from a bunch of other gems too. Very nice.

For anyone ending up on this issue, this snippet might help you:

# Ignore all warnings in Gem dependencies
Gem.path.each do |path|
  Warning.ignore(//, path)
end

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

2 participants