Sha256: 7e9be0bd93c289f612b55381205d467094fe5cba8a8b1507deb4c36e1ef0991f

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/cli/warning_collector'
require_relative '../../../lib/reek/smells/smell_warning'

RSpec.describe Reek::CLI::WarningCollector do
  let(:collector) { described_class.new }

  context 'when empty' do
    it 'reports no warnings' do
      expect(collector.warnings).to eq([])
    end
  end

  context 'with one warning' do
    it 'reports that warning' do
      warning = Reek::Smells::SmellWarning.new(Reek::Smells::FeatureEnvy.new(''),
                                               context: 'fred',
                                               lines:   [1, 2, 3],
                                               message: 'hello')
      collector.found_smell(warning)
      expect(collector.warnings).to eq([warning])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reek-3.3.1 spec/reek/cli/warning_collector_spec.rb
reek-3.3.0 spec/reek/cli/warning_collector_spec.rb