Sha256: 43c2fd23dd6ffb45d99f3eb7ae3623521c6522cc08875556417623419293c88a

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::UrlQuotes do
  context 'when property has a literal URL' do
    let(:css) { <<-CSS }
      p {
        background: url(example.png);
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when property has a URL enclosed in single quotes' do
    let(:css) { <<-CSS }
      p {
        background: url('example.png');
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a URL enclosed in double quotes' do
    let(:css) { <<-CSS }
      p {
        background: url("example.png");
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a literal URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url(example.png);
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when property has a single-quoted URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url('example.png');
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a double-quoted URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url("example.png");
      }
    CSS

    it { should_not report_lint }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scss-lint-0.28.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.27.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.26.2 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.26.1 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.26.0 spec/scss_lint/linter/url_quotes_spec.rb