Sha256: f0f7eb8faa03159102951dca633098cb1feac470dea2fb79d05dc77ed05be848

Contents?: true

Size: 1.19 KB

Versions: 25

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::PlaceholderInExtend do
  context 'when extending with a class' do
    let(:scss) { <<-SCSS }
      p {
        @extend .error;
      }
    SCSS

    it { should report_lint line: 2 }
  end

  context 'when extending with a type' do
    let(:scss) { <<-SCSS }
      p {
        @extend span;
      }
    SCSS

    it { should report_lint line: 2 }
  end

  context 'when extending with an id' do
    let(:scss) { <<-SCSS }
      p {
        @extend #some-identifer;
      }
    SCSS

    it { should report_lint line: 2 }
  end

  context 'when extending with a placeholder' do
    let(:scss) { <<-SCSS }
      p {
        @extend %placeholder;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when extending with a selector whose prefix is not a placeholder' do
    let(:scss) { <<-SCSS }
      p {
        @extend .blah-\#{$dynamically_generated_name};
      }
    SCSS

    it { should report_lint line: 2 }
  end

  context 'when extending with a selector whose prefix is dynamic' do
    let(:scss) { <<-SCSS }
      p {
        @extend \#{$dynamically_generated_placeholder_name};
      }
    SCSS

    it { should_not report_lint }
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
scss-lint-0.37.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-0.36.1 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-0.36.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-0.35.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-0.34.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb