Sha256: 045e37b1e0650622be6bd78bb274491a498cbbf177b22b46d327a038535c4d0f

Contents?: true

Size: 1 KB

Versions: 40

Compression:

Stored size: 1 KB

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(:scss) { '' }

      it { should_not report_lint }
    end

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

      it { should_not report_lint }
    end

    context 'when the file does not end with a newline' do
      let(:scss) { '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(:scss) { '' }

      it { should_not report_lint }
    end

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

      it { should report_lint }
    end

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

      it { should_not report_lint }
    end
  end
end

Version data entries

40 entries across 40 versions & 3 rubygems

Version Path
scss_lint-0.45.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.43.1 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.43.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.42.2 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.42.1 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.40.1 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.40.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.39.0 spec/scss_lint/linter/final_newline_spec.rb
scss_lint-0.38.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.38.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.37.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.36.1 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.36.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.35.0 spec/scss_lint/linter/final_newline_spec.rb
scss-lint-0.34.0 spec/scss_lint/linter/final_newline_spec.rb