Sha256: 56151fa09d92b539cba452e67e22e98748c0a45efbbc1e6317a16fd3fdcc6ef7

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe LintTrap::Linter::CSSLint do
  let(:container){LintTrap::Container::Docker.new(linter.image_version, fixture_path, remove_container: ENV['CI'].nil?)}
  let(:options){{}}
  subject(:linter){described_class.new}

  describe '#version' do
    subject(:dockerfile){Dockerfile.new(linter.name)}

    it 'matches the linters version' do
      expect(dockerfile.include_env?('CSSLINT_VERSION', linter.version)).to be_truthy
    end
  end

  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

2 entries across 2 versions & 1 rubygems

Version Path
lint_trap-0.0.15 spec/integration/csslint_spec.rb
lint_trap-0.0.14 spec/integration/csslint_spec.rb