Sha256: e122594ad9d1c875d4414141c4ba15fb3b538d6c60e2c9f0d18f2867a2e618df

Contents?: true

Size: 1.6 KB

Versions: 25

Compression:

Stored size: 1.6 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::PseudoElement do
  context 'when a pseudo-element has two colons' do
    let(:scss) { <<-SCSS }
      ::before {}
      p::before {}
      p#nav::before {}
      p div::before {}
      p::before div {}
      p, div::before {}
      p::before, div {}
    SCSS

    it { should_not report_lint }
  end

  context 'when a pseudo-element has one colon' do
    let(:scss) { <<-SCSS }
      :before {}
      p:before {}
      p#nav:before {}
      p div:before {}
      p:before div {}
      p, div:before {}
      p:before, div {}
    SCSS

    it { should report_lint line: 1 }
    it { should report_lint line: 2 }
    it { should report_lint line: 3 }
    it { should report_lint line: 4 }
    it { should report_lint line: 5 }
    it { should report_lint line: 6 }
    it { should report_lint line: 7 }
  end

  context 'when a pseudo-selector has one colon' do
    let(:scss) { <<-SCSS }
      :hover {}
      p:hover {}
      p#nav:hover {}
      p div:hover {}
      p:hover div {}
      p, div:hover {}
      p:hover, div {}
    SCSS

    it { should_not report_lint }
  end

  context 'when a pseudo-selector has two colons' do
    let(:scss) { <<-SCSS }
      ::hover {}
      p::hover {}
      p#nav::hover {}
      p div::hover {}
      p::hover div {}
      p, div::hover {}
      p::hover, div {}
    SCSS

    it { should report_lint line: 1 }
    it { should report_lint line: 2 }
    it { should report_lint line: 3 }
    it { should report_lint line: 4 }
    it { should report_lint line: 5 }
    it { should report_lint line: 6 }
    it { should report_lint line: 7 }
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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