From aa19b6e99d60cfcb97afa5d6ecff5124ad0bd161 Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Tue, 23 Apr 2019 11:19:51 -0400 Subject: [PATCH] Add helper to filter out deprecations on stderr Signed-off-by: Clinton Wolfe --- test/functional/helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/helper.rb b/test/functional/helper.rb index e662cae31..1bcd7034e 100644 --- a/test/functional/helper.rb +++ b/test/functional/helper.rb @@ -42,6 +42,14 @@ module Inspec msg += "\nSTDERR:\n" + stderr msg.must_equal '' end + + def stderr_ignore_deprecations + stderr.split("\n").reject { |l| l.include? ' DEPRECATION: ' }.join("\n") + end + + def stdout_ignore_deprecations + stdout.split("\n").reject { |l| l.include? ' DEPRECATION: ' }.join("\n") + end end end