Sha256: 9cfb886fca9dffa9f28cb88007f41808c377e2841830f2982f8982bd13b6a4d6

Contents?: true

Size: 833 Bytes

Versions: 33

Compression:

Stored size: 833 Bytes

Contents

require_relative '../../spec_helper'
require_lib 'reek/cli/warning_collector'
require_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,
                                               source:  'string',
                                               context: 'foo',
                                               lines:   [1, 2, 3],
                                               message: 'hello')
      collector.found_smell(warning)
      expect(collector.warnings).to eq([warning])
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
reek-4.4.0 spec/reek/cli/warning_collector_spec.rb
reek-4.3.0 spec/reek/cli/warning_collector_spec.rb
reek-4.2.5 spec/reek/cli/warning_collector_spec.rb
reek-4.2.4 spec/reek/cli/warning_collector_spec.rb
reek-4.2.3 spec/reek/cli/warning_collector_spec.rb
reek-4.2.2 spec/reek/cli/warning_collector_spec.rb
reek-4.2.1 spec/reek/cli/warning_collector_spec.rb
reek-4.2.0 spec/reek/cli/warning_collector_spec.rb
reek-4.1.1 spec/reek/cli/warning_collector_spec.rb
reek-4.1.0 spec/reek/cli/warning_collector_spec.rb
reek-4.0.5 spec/reek/cli/warning_collector_spec.rb
reek-4.0.4 spec/reek/cli/warning_collector_spec.rb
reek-4.0.3 spec/reek/cli/warning_collector_spec.rb
reek-4.0.2 spec/reek/cli/warning_collector_spec.rb
reek-4.0.1 spec/reek/cli/warning_collector_spec.rb
reek-4.0.0 spec/reek/cli/warning_collector_spec.rb
reek-4.0.0.pre1 spec/reek/cli/warning_collector_spec.rb
reek-3.11 spec/reek/cli/warning_collector_spec.rb
reek-3.10.2 spec/reek/cli/warning_collector_spec.rb
reek-3.10.1 spec/reek/cli/warning_collector_spec.rb