Sha256: be6fb05aea4dce0ddd9d1590519064611ff26f13464811d03752e153bc8d68d8

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

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

describe Rubycritic::SmellAdapter::Reek do
  context "when analysing a smelly file" do
    before do
      sample_paths = ["test/samples/reek/smelly.rb"]
      @adapter = Rubycritic::SmellAdapter::Reek.new(sample_paths)
    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_paths = ["test/samples/reek/not_smelly.rb"]
      @adapter = Rubycritic::SmellAdapter::Reek.new(sample_paths)
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-0.0.11 test/lib/rubycritic/smell_adapters/reek_test.rb