Sha256: 8aa480a55cbdb8c6a35bd520816a1f60843afb9f8ad0e6bec7f8f710f4e9f12b

Contents?: true

Size: 1.51 KB

Versions: 17

Compression:

Stored size: 1.51 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

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

    it { should_not report_lint }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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