Sha256: d0b45867310fa5213c3dc8a880aa5c0714a44bef3426bc5a759ea0f1ee6d688f
Contents?: true
Size: 1.23 KB
Versions: 40
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe SCSSLint::Linter::IdSelector do context 'when rule is a type' do let(:scss) { 'p {}' } it { should_not report_lint } end context 'when rule is an ID' do let(:scss) { '#identifier {}' } it { should report_lint line: 1 } end context 'when rule is a class' do let(:scss) { '.class {}' } it { should_not report_lint } end context 'when rule is a type with a class' do let(:scss) { 'a.class {}' } it { should_not report_lint } end context 'when rule is a type with an ID' do let(:scss) { 'a#identifier {}' } it { should report_lint line: 1 } end context 'when rule is an ID with a pseudo-selector' do let(:scss) { '#identifier:active {}' } it { should report_lint line: 1 } end context 'when rule contains a nested rule with type and ID' do let(:scss) { <<-SCSS } p { a#identifier {} } SCSS it { should report_lint line: 2 } end context 'when rule contains multiple selectors' do context 'when all of the selectors are just IDs, classes, or types' do let(:scss) { <<-SCSS } #identifier, .class, a { } SCSS it { should report_lint line: 1 } end end end
Version data entries
40 entries across 40 versions & 3 rubygems