Skip to content

Commit

Permalink
Suppress output from mail parser warnings
Browse files Browse the repository at this point in the history
Previously, requiring any of the ragel generated parsers in mail would
output tons of warnings in tests, making output much harder to read
(especially in Railties).

This commit extends the RaiseWarnings patch to suppress output from
these mail parsers.

The suppression can be removed once mikel/mail#1557 or mikel/mail#1551
or any other PR fixes the issue
  • Loading branch information
skipkayhil committed Feb 23, 2023
1 parent b0dd7c7 commit e027101
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions activesupport/lib/active_support/testing/strict_warnings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ module RaiseWarnings
/Ignoring .*\.yml because it has expired/,
/Failed to validate the schema cache because/,
)

SUPPRESSED_WARNINGS = Regexp.union(
# TODO: remove if https://github.com/mikel/mail/pull/1557 or similar fix
%r{/lib/mail/parsers/.*statement not reached},
%r{/lib/mail/parsers/.*assigned but unused variable - testEof}
)

def warn(message, *)
return if SUPPRESSED_WARNINGS.match?(message)

super

return unless message.include?(PROJECT_ROOT)
Expand Down

0 comments on commit e027101

Please sign in to comment.