Sha256: f66bb1c50eefbef332397954710a142a1b1e8286d250968f0e03a72cf070e93b

Contents?: true

Size: 1.19 KB

Versions: 11

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

11 entries across 11 versions & 1 rubygems

Version Path
reek-6.0.3 spec/reek/configuration/rake_task_converter_spec.rb
reek-6.0.2 spec/reek/configuration/rake_task_converter_spec.rb
reek-6.0.1 spec/reek/configuration/rake_task_converter_spec.rb
reek-6.0.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.6.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.5.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.4.1 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.4.0 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.3.2 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.3.1 spec/reek/configuration/rake_task_converter_spec.rb
reek-5.3.0 spec/reek/configuration/rake_task_converter_spec.rb