Sha256: 34d1d3811decc59adce7084084fdb6c5820765006812fd0e767ccc9908a8fc1c

Contents?: true

Size: 993 Bytes

Versions: 17

Compression:

Stored size: 993 Bytes

Contents

require_relative '../../../spec_helper'
require_lib 'reek/report/formatter'

RSpec.describe Reek::Report::Formatter::BlankLocationFormatter do
  let(:warning) { build(:smell_warning, lines: [11, 9, 250, 100]) }

  describe '.format' do
    it 'returns a blank String regardless of the warning' do
      expect(described_class.format(warning)).to eq('')
    end
  end
end

RSpec.describe Reek::Report::Formatter::DefaultLocationFormatter do
  let(:warning) { build(:smell_warning, lines: [11, 9, 250, 100]) }

  describe '.format' do
    it 'returns a prefix with sorted line numbers' do
      expect(described_class.format(warning)).to eq('[9, 11, 100, 250]:')
    end
  end
end

RSpec.describe Reek::Report::Formatter::SingleLineLocationFormatter do
  let(:warning) { build(:smell_warning, lines: [11, 9, 250, 100]) }

  describe '.format' do
    it 'returns the first line where the smell was found' do
      expect(described_class.format(warning)).to eq('dummy_file:9: ')
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
reek-4.8.2 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.8.1 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.8.0 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.7.3 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.7.2 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.7.1 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.7.0 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.6.2 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.6.1 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.6.0 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.6 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.5 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.4 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.3 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.2 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.1 spec/reek/report/formatter/location_formatter_spec.rb
reek-4.5.0 spec/reek/report/formatter/location_formatter_spec.rb