Sha256: 35b1cb8bf3f76fcf2d26e6dbdd7ef2f16d9017ec38af6cc8b449a02f029c2436

Contents?: true

Size: 954 Bytes

Versions: 9

Compression:

Stored size: 954 Bytes

Contents

require "test_helper"
require "rubycritic/analysers/reek"
require "rubycritic/smell_adapters/reek"

describe Rubycritic::SmellAdapter::Reek do
  context "when analysing a smelly file" do
    before do
      sample_path = "test/samples/reek/smelly.rb"
      reek = Rubycritic::Analyser::Reek.new([sample_path])
      @adapter = Rubycritic::SmellAdapter::Reek.new(reek)
    end

    it "detects smells" do
      @adapter.smells.wont_be_empty
    end

    it "has smells with messages" do
      smell = @adapter.smells.first
      smell.message.must_equal "has boolean parameter 'reek'"
    end
  end

  context "when analysing a file with smells ignored in config.reek" do
    before do
      sample_path = "test/samples/reek/not_smelly.rb"
      reek = Rubycritic::Analyser::Reek.new([sample_path])
      @adapter = Rubycritic::SmellAdapter::Reek.new(reek)
    end

    it "does not detect smells" do
      @adapter.smells.must_be_empty
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubycritic-0.0.10 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.9 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.8 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.7 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.6 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.5 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.4 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.3 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb
rubycritic-0.0.2 test/lib/rubycritic/metric_adapters/reek_adapter_test.rb