Sha256: d301cc01cae2b55f854fc6b826666a1581d1fc0ff0502dd30700b83fe99390ed

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::ChainedClasses do
  context 'with a single class' do
    let(:scss) { <<-SCSS }
      .class {}
    SCSS

    it { should_not report_lint }
  end

  context 'with a single class with a descendant ' do
    let(:scss) { <<-SCSS }
      .class .descendant {}
    SCSS

    it { should_not report_lint }
  end

  context 'with a chained class' do
    let(:scss) { <<-SCSS }
      .chained.class {}
    SCSS

    it { should report_lint line: 1 }
  end

  context 'with a chained class in a nested rule set' do
    let(:scss) { <<-SCSS }
      p {
        .chained.class {}
      }
    SCSS

    it { should report_lint line: 2 }
  end

  context 'with a chained class in part of a sequence' do
    let(:scss) { <<-SCSS }
      .some .sequence .with .chained.class .in .it {}
    SCSS

    it { should report_lint line: 1 }
  end

  context 'with a chained class in a multiline comma sequence' do
    let(:scss) { <<-SCSS }
      .one,
      .two.three {}
    SCSS

    it { should report_lint line: 2 }
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
scss_lint-0.45.0 spec/scss_lint/linter/chained_classes_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/chained_classes_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/chained_classes_spec.rb