Sha256: e4f168e9079c0c7e68ec0aa46307ce304c330476acdc42f4cc0ee7e2b1cc3f8e

Contents?: true

Size: 1.72 KB

Versions: 19

Compression:

Stored size: 1.72 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::SingleLinePerProperty do
  context 'when properties are each on their own line' do
    let(:scss) { <<-SCSS }
      p {
        color: #fff;
        margin: 0;
        padding: 5px;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when two properties share a line' do
    let(:scss) { <<-SCSS }
      p {
        color: #fff;
        margin: 0; padding: 5px;
      }
    SCSS

    it { should_not report_lint line: 2 }
    it { should report_lint line: 3, count: 1 }
  end

  context 'when multiple properties share a line' do
    let(:scss) { <<-SCSS }
      p {
        color: #fff; margin: 0; padding: 5px;
      }
    SCSS

    it { should report_lint line: 2, count: 2 }
  end

  context 'when multiple properties share a line on a single line rule set' do
    let(:scss) { <<-SCSS }
      p { color: #fff; margin: 0; padding: 5px; }
    SCSS

    context 'and single line rule sets are allowed' do
      let(:linter_config) { { 'allow_single_line_rule_sets' => true } }

      it { should_not report_lint }
    end

    context 'and single line rule sets are not allowed' do
      let(:linter_config) { { 'allow_single_line_rule_sets' => false } }

      it { should report_lint }
    end
  end

  context 'when a single line rule set contains a single property' do
    let(:scss) { <<-SCSS }
      p { color: #fff; }
    SCSS

    context 'and single line rule sets are allowed' do
      let(:linter_config) { { 'allow_single_line_rule_sets' => true } }

      it { should_not report_lint }
    end

    context 'and single line rule sets are not allowed' do
      let(:linter_config) { { 'allow_single_line_rule_sets' => false } }

      it { should report_lint }
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

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