Skip to content

Commit

Permalink
Test: filter out warnings from the mail gem
Browse files Browse the repository at this point in the history
These warnings are not relevant to the output, but dominate it.

I borrowed the Warning example from the Ruby documentation.
  • Loading branch information
olleolleolle committed Nov 24, 2023
1 parent 58f1ee8 commit 2fd8a0f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,16 @@ def run_check(name)
# Swallow everything to be able to test erroring checks.
self.error_handler = ->(error, context) {}
end

module TestRunWarningFilter
# Had some trouble with spurious warnings output in mail v2.8.1 gem. Ignore that, to focus output.
def warn(message, category: nil, **kwargs)
if %r{gems/mail-.+/lib/}.match?(message)
# ignore
else
super
end
end
end
Warning.extend TestRunWarningFilter

0 comments on commit 2fd8a0f

Please sign in to comment.