From 3dffd8a8b7062be2b1ac48500dfc71c866205908 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Wed, 25 Nov 2015 21:24:00 -0600 Subject: [PATCH] Add more warnings ignore directories --- test/capture_warnings.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/capture_warnings.rb b/test/capture_warnings.rb index 7eb75c50..d3674cab 100644 --- a/test/capture_warnings.rb +++ b/test/capture_warnings.rb @@ -9,7 +9,11 @@ class CaptureWarnings @app_root ||= Dir.pwd @output_dir = File.join(app_root, 'tmp') FileUtils.mkdir_p(output_dir) - @bundle_dir = File.join(app_root, 'bundle') + @ignore_dirs = [ + File.join(app_root, '.bundle'), + File.join(app_root, 'bundle'), + File.join(app_root, 'vendor') + ] @output = STDOUT end @@ -28,7 +32,7 @@ class CaptureWarnings def after_tests(lines) app_warnings, other_warnings = lines.partition do |line| - line.include?(app_root) && !line.include?(bundle_dir) + line.include?(app_root) && ignore_dirs.none? { |ignore_dir| line.include?(ignore_dir) } end if app_warnings.any? @@ -67,5 +71,5 @@ class CaptureWarnings private - attr_reader :stderr_file, :app_root, :output_dir, :bundle_dir, :fail_on_warnings, :output + attr_reader :stderr_file, :app_root, :output_dir, :ignore_dirs, :fail_on_warnings, :output end