Sha256: 617fbe103b5f69e15faf81230218b8e2709814693c11beb914f756b00c8a966e

Contents?: true

Size: 838 Bytes

Versions: 7

Compression:

Stored size: 838 Bytes

Contents

require 'spec_helper'

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

    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(:css) { <<-CSS }
      p {
        background: #000;
        color: #FFFFFF;
        border-color: red;
        filter: #{gradient_css};
      }
    CSS

    it { should_not report_lint }
  end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scss-lint-0.33.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.32.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.31.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.30.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.29.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.28.0 spec/scss_lint/linter/hex_validation_spec.rb
scss-lint-0.27.0 spec/scss_lint/linter/hex_validation_spec.rb