Skip to content

Commit

Permalink
Ignore Ruby warnings from all gems
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Oct 4, 2023
1 parent 4fe8fdf commit 1a08069
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/support/warnings.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
if RUBY_VERSION >= "2.4"
require "warning"

Warning.process('', /instance variable @\w+ not initialized/ => :raise)

Warning.ignore(/instance variable @\w+ not initialized/, Gem::Specification.find_by_name("httpx").load_paths.first)

# ruby 2.5 or higher uses http.rb 5.0 which doesn't have http-parser as a dependency
if RUBY_VERSION < "2.5"
Warning.ignore(/interpreted as argument prefix/, Gem::Specification.find_by_name("http-parser").load_paths.first)
Gem.path.each do |path|
Warning.ignore(//, path)
end
end

0 comments on commit 1a08069

Please sign in to comment.