Sha256: 4ce9319ea01f191df5767485e05fc8a98d645fc2c2ced297a2e06bd0fb3b15cd

Contents?: true

Size: 595 Bytes

Versions: 7

Compression:

Stored size: 595 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
      @collector.warnings.should == []
    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
      @collector.warnings.should == [@warning]
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reek-1.3.8 spec/reek/core/warning_collector_spec.rb
reek-1.3.7 spec/reek/core/warning_collector_spec.rb
reek-1.3.6 spec/reek/core/warning_collector_spec.rb
reek-1.3.5 spec/reek/core/warning_collector_spec.rb
reek-1.3.4 spec/reek/core/warning_collector_spec.rb
reek-1.3.3 spec/reek/core/warning_collector_spec.rb
reek-1.3.2 spec/reek/core/warning_collector_spec.rb