Sha256: 503ace8ab97619556ba3b3fcb349b0c7d022ba3409d305d0c34ec0656eda2b32

Contents?: true

Size: 1.35 KB

Versions: 31

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::ExtendDirective 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 report_lint line: 2 }
  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 report_lint line: 2 }
  end

  context 'when not using extend' do
    let(:scss) { <<-SCSS }
      p {
        @include mixin;
      }
    SCSS

    it { should_not report_lint }
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
scss_lint-0.60.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.59.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.58.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.57.1 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.57.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.56.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.55.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.54.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.53.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.52.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.51.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.50.3 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.50.2 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.50.1 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.50.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.49.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.48.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.47.1 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.47.0 spec/scss_lint/linter/extend_directive_spec.rb
scss_lint-0.46.0 spec/scss_lint/linter/extend_directive_spec.rb