Sha256: 527d921384aaa741e42d23667052a05ed618a15d7a69c84a0c26daec84d22303

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

require 'reek/configuration'
require 'reek/smells/duplication'
require 'reek/smells/large_class'
require 'reek/smells/long_method'

include Reek
include Reek::Smells

describe SmellDetector, 'configuration' do
  before:each do
    @detector = LongMethod.new
  end

  it 'adopts new max_statements value' do
    @detector.configure_with(LongMethod::MAX_ALLOWED_STATEMENTS_KEY => 25)
    @detector.value(LongMethod::MAX_ALLOWED_STATEMENTS_KEY, nil, 0).should == 25
  end
end

describe SmellDetector, 'configuration' do
#  it 'stays enabled when not disabled' do
#    @detector = LargeClass.new
#    @detector.should be_enabled
#    @detector.configure({'LargeClass' => {'max_methods' => 50}})
#    @detector.should be_enabled
#  end

  it 'becomes disabled when disabled' do
    @detector = LargeClass.new
    @detector.should be_enabled
    @detector.configure({'LargeClass' => {SmellConfiguration::ENABLED_KEY => false}})
    @detector.should_not be_enabled
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-1.2.6 spec/reek/smells/smell_detector_spec.rb
reek-1.2.5 spec/reek/smells/smell_detector_spec.rb
reek-1.2.4 spec/reek/smells/smell_detector_spec.rb