Sha256: cbc6016b334a800eeeb79ca5885b4251039823e031b23a255bfa57a5e059832a

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 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, nil]
      end
      let(:lints) do
        linters.each.map do |linter|
          SCSSLint::Lint.new(linter ? linter.new : nil, '',
                             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

16 entries across 16 versions & 1 rubygems

Version Path
scss_lint-0.55.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.54.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.53.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.52.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.51.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.50.3 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.50.2 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.50.1 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.50.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.49.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.48.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.47.1 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.47.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.46.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.45.0 spec/scss_lint/reporter/config_reporter_spec.rb
scss_lint-0.44.0 spec/scss_lint/reporter/config_reporter_spec.rb