Sha256: 6f1725b5650af72409e300a56342359d5b218871ed58defba4417165acd56855

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::DisableLinterReason do
  context 'when no disabling instructions exist' do
    let(:scss) { <<-SCSS }
      // Comment.
      p {
        margin: 0;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when no reason accompanies a disabling comment' do
    let(:scss) { <<-SCSS }
      // scss-lint:disable BorderZero
      p {
        margin: 0;
      }
    SCSS

    it { should report_lint line: 1 }
  end

  context 'when a reason immediately precedes a disabling comment' do
    let(:scss) { <<-SCSS }
      // We like using `border: none` in our CSS.
      // scss-lint:disable BorderZero
      p {
        margin: 0;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when a reason precedes a disabling comment, at a distance' do
    let(:scss) { <<-SCSS }
      // We like using `border: none` in our CSS.

      // scss-lint:disable BorderZero
      p {
        margin: 0;
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when no reason precedes an enabling comment' do
    let(:scss) { <<-SCSS }
      // Disable for now
      // scss-lint:disable BorderZero
      p {
        border: none;
      }
      // scss-lint:enable BorderZero
    SCSS

    it { should_not report_lint }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
scss_lint-0.47.1 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.47.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.46.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.45.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.43.1 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.43.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.42.2 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.42.1 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/disable_linter_reason_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/disable_linter_reason_spec.rb