Sha256: 1df4c970c0c3b842d73596945056141cc87a7da70940a3be717c9153de808e74

Contents?: true

Size: 989 Bytes

Versions: 16

Compression:

Stored size: 989 Bytes

Contents

require 'spec_helper'

describe SCSSLint::Reporter::FilesReporter do
  subject { described_class.new(lints, [], nil) }

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

      it 'returns nil' do
        subject.report_lints.should be_nil
      end
    end

    context 'when there are lints' do
      let(:filenames) { ['some-filename.scss', 'some-filename.scss', 'other-filename.scss'] }

      let(:lints) do
        filenames.map do |filename|
          SCSSLint::Lint.new(nil, filename, SCSSLint::Location.new, '')
        end
      end

      it 'prints each file on its own line' do
        subject.report_lints.count("\n").should == 2
      end

      it 'prints a trailing newline' do
        subject.report_lints[-1].should == "\n"
      end

      it 'prints the filename for each lint' do
        filenames.each do |filename|
          subject.report_lints.scan(filename).count.should == 1
        end
      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/files_reporter_spec.rb
scss_lint-0.54.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.53.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.52.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.51.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.50.3 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.50.2 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.50.1 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.50.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.49.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.48.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.47.1 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.47.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.46.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.45.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.44.0 spec/scss_lint/reporter/files_reporter_spec.rb