spec/integration/checkstyle_spec.rb in lint_trap-0.0.6 vs spec/integration/checkstyle_spec.rb in lint_trap-0.0.7
- old
+ new
@@ -1,17 +1,18 @@
require 'spec_helper'
describe LintTrap::Linter::CheckStyle do
- let(:container){LintTrap::Container::Fake.new}
- subject(:linter){described_class.new(container: container)}
+ let(:container){LintTrap::Container::Docker.new('lintci/spin_cycle:latest', fixture_path)}
+ let(:options){{}}
+ subject(:linter){described_class.new}
- shared_examples '#lint' do
+ describe '#lint' do
context 'when linting a bad file' do
let(:file){fixture_path('bad.java')}
it 'generates lint' do
- expect{|b| linter.lint([file], &b)}.to yield_successive_args(
+ expect{|b| linter.lint([file], container, options, &b)}.to yield_successive_args(
{
file: file,
line: '1',
column: '0',
length: nil,
@@ -33,20 +34,10 @@
context 'when linting a good file' do
let(:file){fixture_path('Good.java')}
it 'generates no lint' do
- expect{|b| linter.lint([file], &b)}.to_not yield_control
+ expect{|b| linter.lint([file], container, options, &b)}.to_not yield_control
end
end
- end
-
- context 'with docker container', if: !ENV['SKIP_DOCKER'] do
- let(:container){LintTrap::Container::Docker.new('lintci/spin_cycle:latest', fixture_path)}
-
- it_behaves_like '#lint'
- end
-
- context 'without a docker container', if: ENV['SKIP_DOCKER'] do
- it_behaves_like '#lint'
end
end