Skip to content
Browse files

Use a default formatter only if notification option is true

As Andrew Nikolaev pointed out: "If the notification option is false,
then there is no need to force the default formatter to add. The
default formatter is only useful in combination with
`-f Guard::RSpec::Formatter::Notification`. In all other cases it is
better to leave the usual behavior of rspec."
  • Loading branch information...
1 parent 8bda8ad commit dae5cd074d10a227c1916e50350dd56c88e6b5f5 Rémy Coutable committed May 14, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/guard/rspec/runner.rb
  2. +1 −1 spec/guard/rspec/runner_spec.rb
View
2 lib/guard/rspec/runner.rb
@@ -79,8 +79,8 @@ def parsed_or_default_formatter
def rspec_arguments(paths, options)
arg_parts = []
arg_parts << options[:cli]
- arg_parts << parsed_or_default_formatter unless options[:cli] =~ formatter_regex
if @options[:notification]
+ arg_parts << parsed_or_default_formatter unless options[:cli] =~ formatter_regex
arg_parts << "-r #{File.dirname(__FILE__)}/formatters/notification_#{rspec_class.downcase}.rb"
arg_parts << "-f Guard::RSpec::Formatter::Notification#{rspec_class}#{rspec_version == 1 ? ":" : " --out "}/dev/null"
end
View
2 spec/guard/rspec/runner_spec.rb
@@ -302,7 +302,7 @@
it 'runs without notification formatter' do
subject.should_receive(:system).with(
- 'bundle exec rspec -f progress --failure-exit-code 2 spec'
+ 'bundle exec rspec --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])

1 comment on commit dae5cd0

@thibaudgg
Guard member

Yeah, +1

Please sign in to comment.
Something went wrong with that request. Please try again.