Sha256: f84defd018d067be1fde13bb7089a0a95c13bad335b5335d46105c4829e09c04

Contents?: true

Size: 1.57 KB

Versions: 15

Compression:

Stored size: 1.57 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::PropertySpelling do
  context 'with a regular property' do
    let(:scss) { <<-SCSS }
      p {
        margin: 5px;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'with a property containing interpolation' do
    let(:scss) { <<-SCSS }
      p {
        \#{$property-name}: 5px;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'with a non-existent property' do
    let(:scss) { <<-SCSS }
      p {
        peanut-butter: jelly-time;
      }
    SCSS

    it { should report_lint }
  end

  context 'when extra properties are specified' do
    let(:linter_config) { { 'extra_properties' => ['made-up-property'] } }

    context 'with a non-existent property' do
      let(:scss) { <<-SCSS }
        p {
          peanut-butter: jelly-time;
        }
      SCSS

      it { should report_lint }
    end

    context 'with a property listed as an extra property' do
      let(:scss) { <<-SCSS }
        p {
          made-up-property: value;
        }
      SCSS

      it { should_not report_lint }
    end
  end

  context 'with valid nested properties' do
    let(:scss) { <<-SCSS }
      p {
        text: {
          align: center;
          transform: uppercase;
        }
      }
    SCSS

    it { should_not report_lint }
  end

  context 'with invalid nested properties' do
    let(:scss) { <<-SCSS }
      p {
        text: {
          aligned: center;
          transformed: uppercase;
        }
      }
    SCSS

    it { should report_lint line: 3 }
    it { should report_lint line: 4 }
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
scss_lint-0.42.2 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.42.1 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.40.1 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.40.0 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.39.0 spec/scss_lint/linter/property_spelling_spec.rb
scss_lint-0.38.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.38.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.37.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.36.1 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.36.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.35.0 spec/scss_lint/linter/property_spelling_spec.rb
scss-lint-0.34.0 spec/scss_lint/linter/property_spelling_spec.rb