Sha256: 8d817d8f766c288ee72f6beb72c3c192a77b0bffb9255cebbee01aff584c3667

Contents?: true

Size: 987 Bytes

Versions: 21

Compression:

Stored size: 987 Bytes

Contents

require 'spec_helper'

describe SCSSLint::Reporter::FilesReporter do
  subject { described_class.new(lints) }

  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

21 entries across 21 versions & 3 rubygems

Version Path
scss_lint-0.40.1 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.40.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.39.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss_lint-0.38.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.38.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.37.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.36.1 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.36.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.35.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.34.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.33.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.32.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.31.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.30.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.29.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.28.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.27.0 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.26.2 spec/scss_lint/reporter/files_reporter_spec.rb
scss-lint-0.26.1 spec/scss_lint/reporter/files_reporter_spec.rb