Sha256: 1a65e02b7e8d60e62baa83defc31930ccfc0b887e84285f968cca20ec046be7f

Contents?: true

Size: 863 Bytes

Versions: 3

Compression:

Stored size: 863 Bytes

Contents

require "test_helper"
require "rubycritic/smells_aggregator"

describe Rubycritic::SmellsAggregator do
  context "when analysing smelly files" do
    before do
      smell1 = Rubycritic::Smell.new
      smell2 = Rubycritic::Smell.new
      @smells = [smell2, smell1]
      @smell_adapters = [stub(:smells => [smell1]), stub(:smells => [smell2])]
    end

    describe "#smells" do
      it "returns the smells found in those files" do
        Rubycritic::SmellsAggregator.new(@smell_adapters).smells.must_equal @smells
      end
    end
  end

  context "when analysing files with no smells" do
    before do
      @smells = []
      @smell_adapters = [stub(:smells => @smells)]
    end

    describe "#smells" do
      it "returns an empty array" do
        Rubycritic::SmellsAggregator.new(@smell_adapters).smells.must_equal @smells
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubycritic-0.0.10 test/lib/rubycritic/smells_aggregator_test.rb
rubycritic-0.0.9 test/lib/rubycritic/smells_aggregator_test.rb
rubycritic-0.0.8 test/lib/rubycritic/smells_aggregator_test.rb