spec/linter/checkstyle_spec.rb in lint_trap-0.0.11 vs spec/linter/checkstyle_spec.rb in lint_trap-0.0.13

- old
+ new

@@ -8,40 +8,44 @@ subject(:linter){described_class.new} it_behaves_like 'linter' its(:languages){is_expected.to eq([LintTrap::Language::Java.new])} + its(:version){is_expected.to eq('6.6')} + its(:image){is_expected.to eq('lintci/checkstyle')} + its(:image_version){is_expected.to eq('lintci/checkstyle:6.6')} + its(:jar){is_expected.to eq('checkstyle/checkstyle_logger-6.6-all.jar')} describe '#lint' do context 'when config is provided' do 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), + '-jar', container.config_path(linter.jar), '-c', options[:config] ], files ).and_return(command) - expect(command).to receive(:run).with(container) + expect(command).to receive(:run).with(container).and_return(true) linter.lint(files, container, options) end end context 'when config is not provided' do 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), + '-jar', container.config_path(linter.jar), '-c', container.config_path(described_class::CHECKS_XML) ], files ).and_return(command) - expect(command).to receive(:run).with(container) + expect(command).to receive(:run).with(container).and_return(true) linter.lint(files, container, options) end end end