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.45.0 spec/scss_lint/linter/pseudo_element_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/pseudo_element_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/pseudo_element_spec.rb
scss_lint-0.43.1 spec/scss_lint/linter/pseudo_element_spec.rb
scss_lint-0.43.0 spec/scss_lint/linter/pseudo_element_spec.rb