Sha256: 07c6613dfd58ea49f0964842babfd47d0cd19b21611853fe748e23163e3f895e

Contents?: true

Size: 847 Bytes

Versions: 14

Compression:

Stored size: 847 Bytes

Contents

require 'spec_helper'

describe SCSSLint::Linter::HexValidation do
  context 'when rule is empty' do
    let(:scss) { <<-SCSS }
      p {
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when rule contains valid hex codes or color keyword' do
    gradient_css = 'progid:DXImageTransform.Microsoft.gradient' \
                   '(startColorstr=#99000000, endColorstr=#99000000)'

    let(:scss) { <<-SCSS }
      p {
        background: #000;
        color: #FFFFFF;
        border-color: red;
        filter: #{gradient_css};
      }
    SCSS

    it { should_not report_lint }
  end

  context 'when rule contains invalid hex codes' do
    let(:scss) { <<-SCSS }
      p {
        background: #dd;
        color: #dddd;
      }
    SCSS

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

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
scss_lint-0.42.1 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.40.1 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.40.0 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.39.0 spec/scss_lint/linter/hex_validation_spec.rb
scss_lint-0.38.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.38.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.37.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.36.1 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.36.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.35.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.34.0 spec/scss_lint/linter/hex_validation_spec.rb