Sha256: 3c58f0f02e6a95cf55bd0250ddba25963ece71bb43ba9152c08e2cc0a22e815b

Contents?: true

Size: 966 Bytes

Versions: 17

Compression:

Stored size: 966 Bytes

Contents

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

RSpec.describe Reek::Report::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::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::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 15 versions & 2 rubygems

Version Path
reek-6.0.0 spec/reek/report/location_formatter_spec.rb
reek-5.6.0 spec/reek/report/location_formatter_spec.rb
reek-5.5.0 spec/reek/report/location_formatter_spec.rb
reek-5.4.1 spec/reek/report/location_formatter_spec.rb
reek-5.4.0 spec/reek/report/location_formatter_spec.rb
reek-5.3.2 spec/reek/report/location_formatter_spec.rb
reek-5.3.1 spec/reek/report/location_formatter_spec.rb
reek-5.3.0 spec/reek/report/location_formatter_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/location_formatter_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/location_formatter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/location_formatter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/report/location_formatter_spec.rb
reek-5.2.0 spec/reek/report/location_formatter_spec.rb
reek-5.1.0 spec/reek/report/location_formatter_spec.rb
reek-5.0.2 spec/reek/report/location_formatter_spec.rb
reek-5.0.1 spec/reek/report/location_formatter_spec.rb
reek-5.0.0 spec/reek/report/location_formatter_spec.rb