Sha256: 31bb52239f8548bfda4ee782b94f59111c3030d8deeca44f7bc61bd11c457fcd

Contents?: true

Size: 889 Bytes

Versions: 9

Compression:

Stored size: 889 Bytes

Contents

require File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), 'spec_helper')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'core', 'warning_collector')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', '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

9 entries across 9 versions & 1 rubygems

Version Path
reek-1.3.1 spec/reek/core/warning_collector_spec.rb
reek-1.3 spec/reek/core/warning_collector_spec.rb
reek-1.2.13 spec/reek/core/warning_collector_spec.rb
reek-1.2.12 spec/reek/core/warning_collector_spec.rb
reek-1.2.11 spec/reek/core/warning_collector_spec.rb
reek-1.2.10 spec/reek/core/warning_collector_spec.rb
reek-1.2.9 spec/reek/core/warning_collector_spec.rb
reek-1.2.8 spec/reek/core/warning_collector_spec.rb
reek-1.2.7.3 spec/reek/core/warning_collector_spec.rb