Sha256: fc62c87ee3b2443a99d556162cf807152154fbd9402bae39500910580a70cea6

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

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

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

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

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

      it 'generates lint' do
        expect{|b| linter.lint([file], container, options, &b)}.to yield_successive_args(
          file: file,
          line: '2',
          column: '3',
          length: '12',
          rule: 'BorderZero',
          severity: 'warning',
          message: '`border: 0 is preferred over `border: none`'
        )
      end
    end

    context 'when linting a good file' do
      let(:file){fixture_path('good.scss')}

      it 'generates no lint' do
        expect{|b| linter.lint([file], container, options, &b)}.to_not yield_control
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lint_trap-0.0.19 spec/integration/scsslint_spec.rb
lint_trap-0.0.18 spec/integration/scsslint_spec.rb
lint_trap-0.0.17 spec/integration/scsslint_spec.rb
lint_trap-0.0.16 spec/integration/scsslint_spec.rb