Sha256: 08bb50419c7d7a6d29bd8429bfecda4f932c26699a1d8c3ec335ac688f2a6e99
Contents?: true
Size: 1.12 KB
Versions: 7
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' describe SCSSLint::Reporter::ConfigReporter do subject { YAML.load(result) } let(:result) { described_class.new(lints, []).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
7 entries across 7 versions & 1 rubygems