Sha256: a1c1928d608558dd3ebaab81ef69e8ba34ea05d0a1bcd008d7e51b9831ef6645

Contents?: true

Size: 607 Bytes

Versions: 3

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'
require 'reek/core/warning_collector'
require 'reek/smell_warning'

include Reek::Core

describe WarningCollector do
  before(:each) do
    @collector = WarningCollector.new
  end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-1.5.1 spec/reek/core/warning_collector_spec.rb
reek-1.5.0 spec/reek/core/warning_collector_spec.rb
reek-1.4.0 spec/reek/core/warning_collector_spec.rb