Sha256: c6c7ffb4581ec682d6bb10fac3a3bce2da18abad88a780b4f45b5b639de9ea82

Contents?: true

Size: 1.19 KB

Versions: 9

Compression:

Stored size: 1.19 KB

Contents

require_relative '../../spec_helper'
require_lib 'reek/configuration/rake_task_converter'

RSpec.describe Reek::Configuration::RakeTaskConverter do
  describe 'convert' do
    let(:configuration_for_smell_detector) do
      {
        'exclude' => [/Klass#foobar$/, /^Klass#omg$/],
        'reject' => [/^[a-z]$/, /[0-9]$/, /[A-Z]/],
        'accept' => [/^_$/]
      }
    end

    let(:expected_exclude) { ['/Klass#foobar$/', '/^Klass#omg$/'] }
    let(:expected_reject) { ['/^[a-z]$/', '/[0-9]$/', '/[A-Z]/'] }
    let(:expected_accept) { ['/^_$/'] }

    it 'converts exclude regexes to strings' do
      converted_configuration = described_class.convert configuration_for_smell_detector
      expect(converted_configuration['exclude']).to eq(expected_exclude)
    end

    it 'converts reject regexes to strings' do
      converted_configuration = described_class.convert configuration_for_smell_detector
      expect(converted_configuration['reject']).to eq(expected_reject)
    end

    it 'converts accept regexes to strings' do
      converted_configuration = described_class.convert configuration_for_smell_detector
      expect(converted_configuration['accept']).to eq(expected_accept)
    end
  end
end

Version data entries

9 entries across 7 versions & 2 rubygems

Version Path
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/configuration/rake_task_converter_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/configuration/rake_task_converter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/configuration/rake_task_converter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/configuration/rake_task_converter_spec.rb
reek-5.2.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.1.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.0.2 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.0.1 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.0.0 spec/reek/configuration/rake_task_converter_spec.rb