Permalink
Browse files

Deleted default format option, closes guard/guard-rspec#98

  • Loading branch information...
quaternion
quaternion committed Mar 6, 2012
1 parent a0abbc1 commit c033b92ce1dfe4bf1661defb6c2a587254d07782
Showing with 15 additions and 39 deletions.
  1. +1 −3 README.md
  2. +0 −1 lib/guard/rspec/runner.rb
  3. +14 −35 spec/guard/rspec/runner_spec.rb
View
@@ -105,7 +105,7 @@ Former `:color`, `:drb`, `:fail_fast` and `:formatter` options are thus deprecat
``` ruby
:version => 1 # force use RSpec version 1, default: 2
-:cli => "-c -f doc" # pass arbitrary RSpec CLI arguments, default: "-f progress"
+:cli => "-c -f doc" # pass arbitrary RSpec CLI arguments, default: nil
:bundler => false # don't use "bundle exec" to run the RSpec command, default: true
:binstubs => true # use "bin/rspec" to run the RSpec command (implies :bundler => true), default: false
:rvm => ['1.8.7', '1.9.2'] # directly run your specs on multiple Rubies, default: nil
@@ -139,8 +139,6 @@ guard 'rspec', :cli => '-r rspec/instafail -f RSpec::Instafail' do
end
```
-Default formatter is the `progress` formatter (same as RSpec default).
-
Running a subset of all specs
-----------
@@ -30,7 +30,6 @@ 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(/[\s=]/).any? { |w| %w[-f --format].include?(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(' ')
@@ -16,7 +16,7 @@
it "runs with RSpec 2 and without bundler" do
subject.should_receive(:system).with(
- "rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"])
end
@@ -30,7 +30,7 @@
it "runs with RSpec 2 and with Bundler" do
subject.should_receive(:system).with(
- "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"])
end
@@ -55,7 +55,7 @@
subject.run(["spec"], :cli => "--drb")
end
- it "does not notify that RSpec failed when the specs failed" do
+ it "does not notify that RSpec failed when the specs failed" do
subject.should_receive(:rspec_command) { |paths, options| "`exit 2`" }
Guard::Notifier.should_not_receive(:notify).with("Failed", :title => "RSpec results", :image => :failed, :priority => 2)
@@ -74,7 +74,7 @@
describe ":rvm" do
it "runs with rvm exec" do
subject.should_receive(:system).with(
- "rvm 1.8.7,1.9.2 exec bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "rvm 1.8.7,1.9.2 exec bundle exec rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :rvm => ['1.8.7', '1.9.2'])
end
@@ -83,37 +83,16 @@
describe ":cli" do
it "runs with CLI options passed to RSpec" do
subject.should_receive(:system).with(
- "bundle exec rspec --color --drb --fail-fast -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec rspec --color --drb --fail-fast -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :cli => "--color --drb --fail-fast")
end
-
- it "sets progress formatter by default if no formatter is passed in CLI options to RSpec" do
- subject.should_receive(:system).with(
- "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
- ).and_return(true)
- subject.run(["spec"])
- end
-
- it "respects formatter passed in CLI options to RSpec" do
- subject.should_receive(:system).with(
- "bundle exec rspec -f doc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
- ).and_return(true)
- subject.run(["spec"], :cli => "-f doc")
- end
-
- it "respects formatter passed in CLI options to RSpec, using the '=' syntax" do
- subject.should_receive(:system).with(
- "bundle exec rspec --format=doc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
- ).and_return(true)
- subject.run(["spec"], :cli => "--format=doc")
- end
end
describe ":bundler" do
it "runs without Bundler with bundler option to false" do
subject.should_receive(:system).with(
- "rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :bundler => false)
end
@@ -122,37 +101,37 @@
describe ":binstubs" do
it "runs without Bundler with binstubs option to true and bundler option to false" do
subject.should_receive(:system).with(
- "rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :bundler => false, :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option to true and binstubs option to true" do
subject.should_receive(:system).with(
- "bundle exec bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec bin/rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :bundler => true, :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option unset and binstubs option to true" do
subject.should_receive(:system).with(
- "bundle exec bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec bin/rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true and all_after_pass option to true" do
subject.should_receive(:system).with(
- "bundle exec bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec bin/rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :binstubs => true, :all_after_pass => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true and all_on_start option to true" do
subject.should_receive(:system).with(
- "bundle exec bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec bin/rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :binstubs => true, :all_on_start => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true, all_on_start option to true and all_after_pass option to true" do
subject.should_receive(:system).with(
- "bundle exec bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
+ "bundle exec bin/rspec -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec"
).and_return(true)
subject.run(["spec"], :binstubs => true, :all_after_pass => true, :all_on_start => true)
end
@@ -161,7 +140,7 @@
describe ":notification" do
it "runs without notification formatter with notification option to false" 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"], :notification => false)
end
@@ -196,7 +175,7 @@
it "runs with RSpec 1 and with bundler" do
subject.should_receive(:system).with(
- "bundle exec spec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_spec.rb')} -f Guard::RSpec::Formatter::NotificationSpec:/dev/null spec"
+ "bundle exec spec -r #{@lib_path.join('guard/rspec/formatters/notification_spec.rb')} -f Guard::RSpec::Formatter::NotificationSpec:/dev/null spec"
).and_return(true)
subject.run(["spec"])
end

0 comments on commit c033b92

Please sign in to comment.