Sha256: 8d7677f7549d35ed15c8206272d65855b0d58262c1a97cef92f128d2f81d1cdf

Contents?: true

Size: 1.31 KB

Versions: 10

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::UnnecessaryMantissa do
  context 'when value is zero' do
    let(:css) { <<-CSS }
      p {
        margin: 0;
        padding: func(0);
        top: 0em;
      }
    CSS

    it { should_not report_lint }
  end

  context 'when value contains no mantissa' do
    let(:css) { <<-CSS }
      p {
        margin: 1;
        padding: func(1);
        top: 1em;
      }
    CSS

    it { should_not report_lint }
  end

  context 'when value contains a mantissa with a zero' do
    let(:css) { <<-CSS }
      p {
        margin: 1.0;
        padding: func(1.0);
        top: 1.0em;
      }
    CSS

    it { should report_lint line: 2 }
    it { should report_lint line: 3 }
    it { should report_lint line: 4 }
  end

  context 'when value contains a mantissa with multiple zeroes' do
    let(:css) { <<-CSS }
      p {
        margin: 1.000;
        padding: func(1.000);
        top: 1.000em;
      }
    CSS

    it { should report_lint line: 2 }
    it { should report_lint line: 3 }
    it { should report_lint line: 4 }
  end

  context 'when value contains a mantissa with multiple zeroes followed by a number' do
    let(:css) { <<-CSS }
      p {
        margin: 1.0001;
        padding: func(1.0001);
        top: 1.0001em;
      }
    CSS

    it { should_not report_lint }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
scss-lint-0.33.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.32.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.31.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.30.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.29.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.28.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.27.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.26.2 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.26.1 spec/scss_lint/linter/unnecessary_mantissa_spec.rb
scss-lint-0.26.0 spec/scss_lint/linter/unnecessary_mantissa_spec.rb