Sha256: 999a8792fa488a89330c0f8857a822b02f81c8200e0062857d286a1a691b9539

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 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/)
        actual.length.should == @expected.length
        @expected.zip(actual).each do |p|
          actual = p[1] ? p[1].chomp : p[1]
          actual.should == p[0]
        end
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reek-0.3.0 spec/integration_spec.rb