Sha256: a3c6f1d5b31bb5742f28bfea6f412c166ca334cdc78233113054518ea3d4e024

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/smells/smell_detector'
require_relative '../../../lib/reek/smells/smell_repository'

RSpec.describe Reek::Smells::SmellRepository do
  describe '.smell_types' do
    let(:smell_types) { described_class.smell_types }

    it 'should include existing smell_types' do
      expect(smell_types).to include(Reek::Smells::IrresponsibleModule)
      expect(smell_types).to include(Reek::Smells::TooManyStatements)
    end

    it 'should exclude certain smell_types' do
      expect(smell_types).to_not include(Reek::Smells::SmellDetector)
    end

    it 'should return the smell types in alphabetic order' do
      expect(smell_types).to eq(smell_types.sort_by(&:name))
    end

    it "should raise an ArgumentError if smell to configure doesn't exist" do
      repository = described_class.new
      expect { repository.configure('SomethingNonExistant', {}) }.
        to raise_error ArgumentError,
                       'Unknown smell type SomethingNonExistant found in configuration'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
reek-3.3.1 spec/reek/smells/smell_repository_spec.rb
reek-3.3.0 spec/reek/smells/smell_repository_spec.rb
reek-3.2.1 spec/reek/smells/smell_repository_spec.rb
reek-3.2 spec/reek/smells/smell_repository_spec.rb
reek-3.1 spec/reek/smells/smell_repository_spec.rb
reek-3.0.4 spec/reek/smells/smell_repository_spec.rb
reek-3.0.3 spec/reek/smells/smell_repository_spec.rb
reek-3.0.2 spec/reek/smells/smell_repository_spec.rb
reek-3.0.1 spec/reek/smells/smell_repository_spec.rb
reek-3.0.0 spec/reek/smells/smell_repository_spec.rb