Sha256: a1a1b8fde33dc29037bb7b281588aef63f9d280593ab9aaed59f38fd9d9e7101

Contents?: true

Size: 864 Bytes

Versions: 16

Compression:

Stored size: 864 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'

require 'reek/source'

include Reek

describe SourceList, 'from_pathlist' do

  describe 'with no smells in any source' do
    before :each do
      @src = Dir['lib/reek/*.rb'].to_source
    end

    it 'reports no smells' do
      @src.report.length.should == 0
    end

    it 'is empty' do
      @src.report.should be_empty
    end
  end

  describe 'with smells in one source' do
    before :each do
      @src = Source.from_pathlist(["#{SAMPLES_DIR}/inline.rb", 'lib/reek.rb'])
    end

    it 'reports some smells in the samples' do
      @src.report.should have_at_least(30).smells
    end

    it 'is smelly' do
      @src.should be_smelly
    end

    it 'reports an UncommunicativeName' do
      @src.report.any? {|warning| warning.report =~ /Uncommunicative Name/}.should be_true
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
kevinrutherford-reek-1.1.1 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.2.1 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.2 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.1 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.2 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.3 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.4 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.5 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.6 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.7 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.8 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3.9 spec/slow/source_list_spec.rb
kevinrutherford-reek-1.1.3 spec/slow/source_list_spec.rb
teksymmetry-reek-1.1.3.1 spec/slow/source_list_spec.rb
teksymmetry-reek-1.1.3.2 spec/slow/source_list_spec.rb
reek-1.1.3 spec/slow/source_list_spec.rb