Sha256: 6513c4a904a3593d7efd69634d874aee17c6f2994f64180e77931c21084492dc

Contents?: true

Size: 1019 Bytes

Versions: 10

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'

describe SCSSLint::Linter::FinalNewline do
  let(:linter_config) { { 'present' => present } }

  context 'when trailing newline is preferred' do
    let(:present) { true }

    context 'when the file is empty' do
      let(:css) { '' }

      it { should_not report_lint }
    end

    context 'when the file ends with a newline' do
      let(:css) { "p {}\n" }

      it { should_not report_lint }
    end

    context 'when the file does not end with a newline' do
      let(:css) { 'p {}' }

      it { should report_lint }
    end
  end

  context 'when no trailing newline is preferred' do
    let(:present) { false }

    context 'when the file is empty' do
      let(:css) { '' }

      it { should_not report_lint }
    end

    context 'when the file ends with a newline' do
      let(:css) { "p {}\n" }

      it { should report_lint }
    end

    context 'when the file does not end with a newline' do
      let(:css) { 'p {}' }

      it { should_not report_lint }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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