Sha256: 6181536d4845bf601448516e4b7c7239cc85cea19ac51667ccc1845045a1df14

Contents?: true

Size: 905 Bytes

Versions: 20

Compression:

Stored size: 905 Bytes

Contents

require_relative '../../spec_helper'
require_lib 'reek/rake/task'

RSpec.describe Reek::Rake::Task do
  describe '#source_files' do
    it 'is set to "lib/**/*.rb" by default' do
      task = Reek::Rake::Task.new
      expect(task.source_files).to eq FileList['lib/**/*.rb']
    end
  end

  describe '#source_files=' do
    it 'sets source_files to a FileList when passed a string' do
      task = Reek::Rake::Task.new
      task.source_files = '*.rb'
      expect(task.source_files).to eq FileList['*.rb']
    end
  end

  # SMELL: Testing a private method
  describe '#command' do
    let(:task) { Reek::Rake::Task.new }

    it 'does not include a config file by default' do
      expect(task.send(:command)).not_to include '-c'
    end

    it 'includes a config file when set' do
      task.config_file = 'foo.reek'
      expect(task.send(:command)[1..2]).to eq ['-c', 'foo.reek']
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
reek-4.4.1 spec/reek/rake/task_spec.rb
reek-4.4.0 spec/reek/rake/task_spec.rb
reek-4.3.0 spec/reek/rake/task_spec.rb
reek-4.2.5 spec/reek/rake/task_spec.rb
reek-4.2.4 spec/reek/rake/task_spec.rb
reek-4.2.3 spec/reek/rake/task_spec.rb
reek-4.2.2 spec/reek/rake/task_spec.rb
reek-4.2.1 spec/reek/rake/task_spec.rb
reek-4.2.0 spec/reek/rake/task_spec.rb
reek-4.1.1 spec/reek/rake/task_spec.rb
reek-4.1.0 spec/reek/rake/task_spec.rb
reek-4.0.5 spec/reek/rake/task_spec.rb
reek-4.0.4 spec/reek/rake/task_spec.rb
reek-4.0.3 spec/reek/rake/task_spec.rb
reek-4.0.2 spec/reek/rake/task_spec.rb
reek-4.0.1 spec/reek/rake/task_spec.rb
reek-4.0.0 spec/reek/rake/task_spec.rb
reek-4.0.0.pre1 spec/reek/rake/task_spec.rb
reek-3.11 spec/reek/rake/task_spec.rb
reek-3.10.2 spec/reek/rake/task_spec.rb