spec/linter/checkstyle_spec.rb in lint_trap-0.0.6 vs spec/linter/checkstyle_spec.rb in lint_trap-0.0.7
- old
+ new
@@ -1,30 +1,30 @@
require 'spec_helper'
describe LintTrap::Linter::CheckStyle do
let(:container){LintTrap::Container::Fake.new}
- let(:config){nil}
+ let(:options){{}}
let(:files){%w(Good.java bad.java)}
- subject(:linter){described_class.new(container: container, config: config)}
+ subject(:linter){described_class.new}
let(:command){instance_double(LintTrap::Command)}
describe '#lint' do
context 'when config is provided' do
- let(:config){'checks.xml'}
+ let(:options){{config: 'checks.xml'}}
it 'runs the lint command with the correct arguments' do
expect(LintTrap::Command).to receive(:new).with(
'java',
[
'-jar', container.config_path(described_class::JAR),
- '-c', config
+ '-c', options[:config]
],
files
).and_return(command)
expect(command).to receive(:run).with(container)
- linter.lint(files)
+ linter.lint(files, container, options)
end
end
context 'when config is not provided' do
it 'runs the lint command with the correct arguments' do
@@ -36,10 +36,10 @@
],
files
).and_return(command)
expect(command).to receive(:run).with(container)
- linter.lint(files)
+ linter.lint(files, container, options)
end
end
end
end