Sha256: a872e8a6e10ac49b07589a3993540989401959c11ccf4220d223d8f79c661628
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
require 'spec_helper' describe LintTrap::Linter::CSSLint do let(:container){LintTrap::Container::Fake.new} subject(:linter){described_class.new(container: container)} shared_examples '#lint' do context 'when linting a bad file' do let(:file){fixture_path('bad.css')} it 'generates lint' do expect{|b| linter.lint([file], &b)}.to yield_successive_args( { file: file, line: '2', column: '5', length: nil, rule: nil, severity: 'Warning', message: 'Using width with border can sometimes make elements larger than you expect.' } ) end end context 'when linting a good file' do let(:file){fixture_path('good.css')} it 'generates no lint' do expect{|b| linter.lint([file], &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
Version data entries
4 entries across 4 versions & 1 rubygems