Sha256: 690b9a788dfed6e47047b88c025cca5f7bac60034113a5fbba82b1efd552ba56

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe SCSSLint::Reporter::ConfigReporter do
  subject { YAML.load(result) }
  let(:result) { described_class.new(lints, [], nil).report_lints }

  describe '#report_lints' do
    context 'when there are no lints' do
      let(:lints) { [] }

      it 'returns nil' do
        result.should be_nil
      end
    end

    context 'when there are lints' do
      let(:linters) do
        [SCSSLint::Linter::FinalNewline, SCSSLint::Linter::BorderZero,
         SCSSLint::Linter::BorderZero]
      end
      let(:lints) do
        linters.each.map do |linter|
          SCSSLint::Lint.new(linter.new, '',
                             SCSSLint::Location.new, '')
        end
      end

      it 'adds one entry per linter' do
        subject['linters'].size.should eq 2
      end

      it 'sorts linters by name' do
        subject['linters'].map(&:first).should eq %w[BorderZero FinalNewline]
      end

      it 'disables all found linters' do
        subject['linters']['BorderZero']['enabled'].should eq false
        subject['linters']['FinalNewline']['enabled'].should eq false
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
scss_lint-0.60.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.59.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.58.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.57.1 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.57.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.56.0 spec/scss_lint/reporter/config_reporter_spec.rb