From da8bd1225143a04372a7909d2fd4a74e6b0632d7 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 24 Nov 2023 20:47:31 +0100 Subject: [PATCH] Test: filter out warnings from the mail gem (#6) Co-authored-by: fatkodima --- .rubocop.yml | 4 ++++ test/test_helper.rb | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 9651cd0..a925d79 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -47,6 +47,10 @@ Style/FetchEnvVar: Style/HashSyntax: Enabled: false +Style/RegexpLiteral: + EnforcedStyle: slashes + AllowInnerSlashes: true + Lint/MissingSuper: Enabled: false diff --git a/test/test_helper.rb b/test/test_helper.rb index 35a4d68..593eb35 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -73,3 +73,17 @@ def run_check(name) # Swallow everything to be able to test erroring checks. self.error_handler = ->(error, context) {} end + +if defined?(Warning) + module TestRunWarningFilter + # Ignore warnings output from mail v2.8.1 gem. + def warn(message, category: nil, **kwargs) + if message =~ /gems\/mail-/ + # ignore + else + super + end + end + end + Warning.extend TestRunWarningFilter +end