Skip to content

Commit 4590161

Browse files
committed
Merge pull request #1349 from bf4/allow_ruby_head_failures
Add more warnings ignore directories
2 parents 5d0cc59 + 3dffd8a commit 4590161

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/capture_warnings.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ def initialize(fail_on_warnings = true)
99
@app_root ||= Dir.pwd
1010
@output_dir = File.join(app_root, 'tmp')
1111
FileUtils.mkdir_p(output_dir)
12-
@bundle_dir = File.join(app_root, 'bundle')
12+
@ignore_dirs = [
13+
File.join(app_root, '.bundle'),
14+
File.join(app_root, 'bundle'),
15+
File.join(app_root, 'vendor')
16+
]
1317
@output = STDOUT
1418
end
1519

@@ -28,7 +32,7 @@ def execute!
2832

2933
def after_tests(lines)
3034
app_warnings, other_warnings = lines.partition do |line|
31-
line.include?(app_root) && !line.include?(bundle_dir)
35+
line.include?(app_root) && ignore_dirs.none? { |ignore_dir| line.include?(ignore_dir) }
3236
end
3337

3438
if app_warnings.any?
@@ -67,5 +71,5 @@ def after_tests(lines)
6771

6872
private
6973

70-
attr_reader :stderr_file, :app_root, :output_dir, :bundle_dir, :fail_on_warnings, :output
74+
attr_reader :stderr_file, :app_root, :output_dir, :ignore_dirs, :fail_on_warnings, :output
7175
end

0 commit comments

Comments
 (0)