Sha256: e482b35d241420147b750c27c4444262f967e3379b6d98875da8ebe9e9fa802f

Contents?: true

Size: 976 Bytes

Versions: 5

Compression:

Stored size: 976 Bytes

Contents

require 'spec_helper'

describe LintTrap::Linter::CSSLint do
  let(:container){LintTrap::Container::Docker.new('lintci/spin_cycle:latest', fixture_path)}
  let(:options){{}}
  subject(:linter){described_class.new}

  describe '#lint' do
    context 'when linting a bad file' do
      let(:file){fixture_path('bad.css')}

      it 'generates lint' do
        expect{|b| linter.lint([file], container, options, &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], container, options, &b)}.to_not yield_control
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lint_trap-0.0.11 spec/integration/csslint_spec.rb
lint_trap-0.0.10 spec/integration/csslint_spec.rb
lint_trap-0.0.9 spec/integration/csslint_spec.rb
lint_trap-0.0.8 spec/integration/csslint_spec.rb
lint_trap-0.0.7 spec/integration/csslint_spec.rb