Skip to content

Commit

Permalink
Merge pull request #243 from MGotink/reek_config_fix
Browse files Browse the repository at this point in the history
Fix incorrectly passing --config option to reek
  • Loading branch information
bf4 committed Jan 28, 2015
2 parents 2b076f6 + 8d58c2f commit ed8f89a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Expand Up @@ -9,6 +9,7 @@ As such, a _Feature_ would map to either major (breaking change) or minor. A _bu
* Breaking Changes
* Features
* Fixes
* Fix incorrectly passing --config option to reek. (Martin Gotink, #243, fixes #242)
* Misc

### [4.11.2](https://github.com/metricfu/metric_fu/compare/v4.11.1...v4.11.2)
Expand Down
6 changes: 3 additions & 3 deletions lib/metric_fu/metrics/reek/generator.rb
Expand Up @@ -105,7 +105,7 @@ def cli_options(files)
[
disable_line_number_option,
turn_off_color,
config_option,
*config_option,
*files
].reject(&:empty?)
end
Expand All @@ -114,9 +114,9 @@ def cli_options(files)
def config_option
config_file_pattern = options[:config_file_pattern]
if config_file_pattern.to_s.empty?
''
['']
else
"--config #{config_file_pattern}"
['--config', config_file_pattern]
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/metric_fu/metrics/reek/generator_spec.rb
Expand Up @@ -14,7 +14,7 @@
it "includes config file pattern into reek parameters when specified" do
options.merge!({:config_file_pattern => 'lib/config/*.reek' })
expect(reek).to receive(:run!) do |args|
expect(args).to include('--config lib/config/*.reek')
expect(args).to include('--config', 'lib/config/*.reek')
end.and_return('')
reek.emit
end
Expand Down

0 comments on commit ed8f89a

Please sign in to comment.