Sha256: ac1ffd0436f603020be864f4afd0e9964a00600d07df19f3ac53c6f61900ce09

Contents?: true

Size: 754 Bytes

Versions: 6

Compression:

Stored size: 754 Bytes

Contents

require 'spec_helper'

describe SCSSLint::Engine do
  let(:engine) { described_class.new(code: scss) }

  context 'when a @media directive is present' do
    let(:scss) { <<-SCSS }
      @media only screen {
      }
    SCSS

    it 'has a parse tree' do
      engine.tree.should_not be_nil
    end
  end

  context 'when a custom property is present' do
    let(:scss) { <<-SCSS }
      :root {
        --my-font-family: Helvetica;
      }
    SCSS

    it 'has a parse tree' do
      engine.tree.should_not be_nil
    end
  end

  context 'when the file being linted has an invalid byte sequence' do
    let(:scss) { "\xC0\u0001" }

    it 'raises a SyntaxError' do
      expect { engine }.to raise_error(SCSSLint::FileEncodingError)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
scss_lint-0.60.0 spec/scss_lint/engine_spec.rb
scss_lint-0.59.0 spec/scss_lint/engine_spec.rb
scss_lint-0.58.0 spec/scss_lint/engine_spec.rb
scss_lint-0.57.1 spec/scss_lint/engine_spec.rb
scss_lint-0.57.0 spec/scss_lint/engine_spec.rb
scss_lint-0.56.0 spec/scss_lint/engine_spec.rb