Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
Fixed for results displaying more than once when specifying a formatter
Browse files Browse the repository at this point in the history
The modified line was not taking into account a :cli formatting option like this: '--format=documentation' because the .include? test compares the entire line and not just the '--format' option specifier.

This fix greps for the format specifier at the beginning of the string and will disregard the '=' sign and anything that follows.
  • Loading branch information
Chris Blackburn committed Dec 29, 2011
1 parent f5b93ba commit 53cc1fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/guard/rspec/runner.rb
Expand Up @@ -30,7 +30,7 @@ def rspec_command(paths, options={})
cmd_parts << "bundle exec" if (bundler? && options[:binstubs] == true && options[:bundler] != false) || (bundler? && options[:bundler] != false)
cmd_parts << rspec_exec(options)
cmd_parts << options[:cli] if options[:cli]
cmd_parts << "-f progress" if options[:cli].nil? || !options[:cli].split(' ').any? { |w| %w[-f --format].include?(w) }
cmd_parts << "-f progress" if options[:cli].nil? || !options[:cli].split(' ').any? { |w| %w[-f --format].grep(/^#{w}/) }
cmd_parts << "-r #{File.dirname(__FILE__)}/formatters/notification_#{rspec_class.downcase}.rb -f Guard::RSpec::Formatter::Notification#{rspec_class}#{rspec_version == 1 ? ":" : " --out "}/dev/null" if options[:notification] != false
cmd_parts << "--failure-exit-code #{failure_exit_code}" if failure_exit_code_supported?(options)
cmd_parts << paths.join(' ')
Expand Down

0 comments on commit 53cc1fa

Please sign in to comment.