Sha256: c09a8bbcd58e6eca56a62c1c9e48c7aa854d13af3745f4ec589b6e356f88316b

Contents?: true

Size: 1.92 KB

Versions: 14

Compression:

Stored size: 1.92 KB

Contents

require_relative '../../samples/paths'

Given(/^the smelly file '(.+)'$/) do |filename|
  write_file(filename, SAMPLES_DIR.join('smelly_source').join(filename).read)
end

Given(/^the smelly file "(.+)" in the directory "(.+)"$/) do |filename, directory|
  FileUtils.mkdir_p directory
  write_file Pathname(directory).join(filename).to_s,
             SAMPLES_DIR.join('smelly_source').join(filename).read
end

Given(/^the clean file "(.*)"$/) do |filename|
  write_file(filename, CLEAN_FILE.read)
end

Given(/^a directory called 'clean' containing two clean files$/) do
  contents = CLEAN_FILE.read

  write_file('clean/clean_one.rb', contents)
  write_file('clean/clean_two.rb', contents)
end

Given(/^a directory called 'mixed_files' containing some clean and smelly files$/) do
  write_file('mixed_files/clean.rb', CLEAN_FILE.read)
  write_file('mixed_files/dirty.rb', SMELLY_FILE.read)
end

Given(/^a directory called 'smelly' containing two smelly files$/) do
  contents = SMELLY_FILE.read

  write_file('smelly/dirty_one.rb', contents)
  write_file('smelly/dirty_two.rb', contents)
end

Given(/^the smelly file '(.+)' in a subdirectory$/) do |filename|
  contents = SAMPLES_DIR.join('smelly_source').join(filename).read

  write_file("subdir/#{filename}", contents)
end

Given(/^a configuration file '(.+)'$/) do |filename|
  write_file(filename, CONFIGURATION_DIR.join(filename).read)
end

Given(/^our default configuration file$/) do
  default_configuration = File.read SAMPLES_DIR.join('..').join('docs').join('defaults.reek.yml')
  write_file('defaults.reek', default_configuration)
end

When(/^I run "reek (.*?)" in a subdirectory$/) do |args|
  cd 'subdir'

  reek(args)
end

Then(/^it does not report private or protected methods$/) do
  # Pseudo step for feature clarity.
end

Given('with a configuration file that is further up in the directory tree') do
  # Pseudo step for feature clarity. We have an empty .reek.yml in our root directory already.
end

Version data entries

14 entries across 12 versions & 2 rubygems

Version Path
reek-6.0.1 features/step_definitions/sample_file_steps.rb
reek-6.0.0 features/step_definitions/sample_file_steps.rb
reek-5.6.0 features/step_definitions/sample_file_steps.rb
reek-5.5.0 features/step_definitions/sample_file_steps.rb
reek-5.4.1 features/step_definitions/sample_file_steps.rb
reek-5.4.0 features/step_definitions/sample_file_steps.rb
reek-5.3.2 features/step_definitions/sample_file_steps.rb
reek-5.3.1 features/step_definitions/sample_file_steps.rb
reek-5.3.0 features/step_definitions/sample_file_steps.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/features/step_definitions/sample_file_steps.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/step_definitions/sample_file_steps.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/features/step_definitions/sample_file_steps.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/step_definitions/sample_file_steps.rb
reek-5.2.0 features/step_definitions/sample_file_steps.rb