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.49.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.48.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.47.1 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.47.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.46.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.45.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.43.1 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.43.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.42.2 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.42.1 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.40.1 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.40.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.39.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss_lint-0.38.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-0.38.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/linter/placeholder_in_extend_spec.rb