Sha256: b0a9b0c7ed7fb5e12a753ec8997e4d1d1fd104167612e1d8b5dd8183440c43f0

Contents?: true

Size: 980 Bytes

Versions: 1

Compression:

Stored size: 980 Bytes

Contents

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

describe 'Integration test:' do
  Dir['spec/samples/*.rb'].each do |source|
    describe source do
      before :each do
        @expected = IO.readlines(source.sub(/\.rb/, '.reek'))
        @expected.each {|line| line.chomp!}
      end

      it 'should report the correct smells' do
        actual = `ruby -Ilib bin/reek #{source} 2>/dev/null`.split(/\n/)
        @expected.zip(actual).each do |p|
          actual_line = p[1] ? p[1].chomp : p[1]
          actual_line.should == p[0]
        end
        actual.length.should == @expected.length
      end

      it 'should report the correct smells in smell order' do
        actual = `ruby -Ilib bin/reek --sort smell #{source} 2>/dev/null`.split(/\n/)
        @expected.sort.zip(actual).each do |p|
          actual_line = p[1] ? p[1].chomp : p[1]
          actual_line.should == p[0]
        end
        actual.length.should == @expected.length
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reek-0.3.1 spec/integration_spec.rb