Sha256: a48a102e3c789523d04216b2e942846b1f8bc76ec72514d0b50fe54fba60ebfa

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::Comment do
  context 'when no comments exist' do
    let(:css) { <<-CSS }
      p {
        margin: 0;
      }
    CSS

    it { should_not report_lint }
  end

  context 'when comment is a single line comment' do
    let(:css) { '// Single line comment' }

    it { should_not report_lint }
  end

  context 'when comment is a single line comment at the end of a line' do
    let(:css) { <<-CSS }
      p {
        margin: 0; // Comment at end of line
      }
    CSS

    it { should_not report_lint }
  end

  context 'when comment is a multi-line comment' do
    let(:css) { <<-CSS }
      h1 {
        color: #eee;
      }
      /*
       * This is a multi-line comment that should report a lint
       */
      p {
        color: #DDD;
      }
    CSS

    it { should report_lint line: 4 }
  end

  context 'when multi-line-style comment is a at the end of a line' do
    let(:css) { <<-CSS }
      h1 {
        color: #eee; /* This is a comment */
      }
    CSS

    it { should report_lint line: 2 }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
scss-lint-0.33.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.32.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.31.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.30.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.29.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.28.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.27.0 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.26.2 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.26.1 spec/scss_lint/linter/comment_spec.rb
scss-lint-0.26.0 spec/scss_lint/linter/comment_spec.rb