Skip to content

Commit

Permalink
Merge pull request #129 from dpickett/zeus_support
Browse files Browse the repository at this point in the history
zeus support with :zeus => true option
  • Loading branch information
thibaudgg committed Oct 7, 2012
2 parents 0970299 + 376cae4 commit 2d086d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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'`.
Expand Down
8 changes: 7 additions & 1 deletion lib/guard/rspec/runner.rb
Expand Up @@ -15,7 +15,8 @@ def initialize(options = {})
:cli => nil,
:env => nil,
:notification => true,
:turnip => false
:turnip => false,
:zeus => false
}.merge(options)

deprecations_warnings
Expand Down Expand Up @@ -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(' ')
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions spec/guard/rspec/runner_spec.rb
Expand Up @@ -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') }
Expand Down

0 comments on commit 2d086d8

Please sign in to comment.