Permalink
Browse files

Merge pull request #129 from dpickett/zeus_support

zeus support with :zeus => true option
  • Loading branch information...
thibaudgg committed Oct 7, 2012
2 parents 0970299 + 376cae4 commit 2d086d8be457f86b7a1e84b28e7588005a5e0bcd
Showing with 22 additions and 1 deletion.
  1. +1 −0 README.md
  2. +7 −1 lib/guard/rspec/runner.rb
  3. +14 −0 spec/guard/rspec/runner_spec.rb
View
@@ -119,6 +119,7 @@ Former `:color`, `:drb`, `:fail_fast` and `:formatter` options are deprecated an
:run_all => { :cli => "-p" } # cli arguments to use when running all specs, default: same as :cli
:spec_paths => ["spec"] # specify an array of paths that contain spec files
:turnip => true # enable turnip support; default: false
+:zeus => true # enable zeus support; default: false
```
You can also use a custom binstubs directory using `:binstubs => 'some-dir'`.
@@ -15,7 +15,8 @@ def initialize(options = {})
:cli => nil,
:env => nil,
:notification => true,
- :turnip => false
+ :turnip => false,
+ :zeus => false
}.merge(options)
deprecations_warnings
@@ -89,6 +90,7 @@ def rspec_command(paths, options)
cmd_parts << environment_variables
cmd_parts << "rvm #{@options[:rvm].join(',')} exec" if @options[:rvm].respond_to?(:join)
cmd_parts << "bundle exec" if bundle_exec?
+ cmd_parts << 'zeus' if zeus?
cmd_parts << rspec_executable
cmd_parts << rspec_arguments(paths, options)
cmd_parts.compact.join(' ')
@@ -167,6 +169,10 @@ def binstubs?
@binstubs ||= !!@options[:binstubs]
end
+ def zeus?
+ @options[:zeus] || false
+ end
+
def binstubs
@options[:binstubs] == true ? "bin" : @options[:binstubs]
end
@@ -186,6 +186,20 @@
end
end
+ describe ':zeus' do
+ context ":zeus => true" do
+ subject { described_class.new(:zeus => true) }
+
+ it 'runs with zeus' do
+ subject.should_receive(:system).with('bundle exec zeus 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'
+ )
+ subject.run(['spec'])
+ end
+ end
+ end
+
describe ':cli' do
context ":cli => '--color --drb --fail-fast'" do
subject { described_class.new(:cli => '--color --drb --fail-fast') }

0 comments on commit 2d086d8

Please sign in to comment.