Skip to content

Commit

Permalink
Refactor html_formatter_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Jun 18, 2020
1 parent a72f29d commit d7ddd41
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/rubocop/formatter/html_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
end
end

# Run without Style/EndOfLine as it gives different results on
# different platforms.
let(:options) do
%w[--except Layout/EndOfLine --format html --out]
end

let(:actual_html_path) do
path = File.expand_path('result.html')
# Run without Style/EndOfLine as it gives different results on
# different platforms.
RuboCop::CLI.new.run(['--except', 'Layout/EndOfLine', '--format', 'html',
'--out', path])
RuboCop::CLI.new.run([*options, path])
path
end

let(:actual_html_path_cached) do
path = File.expand_path('result_cached.html')
2.times do
RuboCop::CLI.new.run(['--except', 'Layout/EndOfLine', '--format', 'html',
'--out', path])
RuboCop::CLI.new.run([*options, path])
end
path
end
Expand Down

0 comments on commit d7ddd41

Please sign in to comment.