Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zeus support with :zeus => true option #129

Merged
merged 3 commits into from Oct 7, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -121,6 +121,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 @@ -14,7 +14,8 @@ def initialize(options = {})
:rvm => nil,
:cli => nil,
:notification => true,
:turnip => false
:turnip => false,
:zeus => false
}.merge(options)

deprecations_warnings
Expand Down Expand Up @@ -98,6 +99,7 @@ def rspec_command(paths, options)
cmd_parts = []
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?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually better to run zeus outside of bundler. I quote from zeus README:
"Q: "I should put it in my Gemfile, right? A: You can, but running bundle exec zeus instead of zeus can add precious seconds to a command that otherwise would be quite a bit faster. Zeus was built to be run from outside of bundler."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right - I circumvent bundle exec by setting the bundler option to false in my guard configuration block for rspec.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the :zeus => true should set the :bundler to false?

cmd_parts << rspec_executable
cmd_parts << rspec_arguments(paths, options)
cmd_parts.compact.join(' ')
Expand Down Expand Up @@ -193,6 +195,10 @@ def binstubs?
end
end

def zeus?
@options[:zeus] || false
end

def binstubs
if @options[:binstubs] == true
"bin"
Expand Down
14 changes: 14 additions & 0 deletions spec/guard/rspec/runner_spec.rb
Expand Up @@ -202,6 +202,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