Skip to content

Commit

Permalink
added rspec_rails_env and cucumber_rails_env
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbearne committed Apr 15, 2011
1 parent 9716d4e commit 25116ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/guard/spork/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ def initialize(options = {})
options[:wait] ||= 20 # seconds
options[:rspec_port] ||= 8989
options[:cucumber_port] ||= 8990
options[:rspec_rails_env] ||= 'test'
options[:cucumber_rails_env] ||= options[:rspec_rails_env]
@options = options
end

def launch_sporks(action)
UI.info "#{action.capitalize}ing Spork for #{sporked_gems} ", :reset => true
spawn(spork_command("rspec")) if rspec?
spawn(spork_command("cucumber")) if cucumber?
spawn({"RAILS_ENV"=>options[:rspec_rails_env]}, spork_command("rspec")) if rspec?
spawn({"RAILS_ENV"=>options[:cucumber_rails_env]}, spork_command("cucumber")) if cucumber?
verify_launches(action)
end

Expand All @@ -26,12 +28,12 @@ def kill_sporks
private

def spork_command(type)
cmd_parts = []
cmd_parts = []
cmd_parts << "bundle exec" if bundler?
cmd_parts << "spork"

case type
when "rspec"
when "rspec"
cmd_parts << "-p #{options[:rspec_port]}"
when "cucumber"
cmd_parts << "cu"
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/spork/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Guard
module SporkVersion
VERSION = "0.1.5"
VERSION = "0.1.6.dev"
end
end

0 comments on commit 25116ac

Please sign in to comment.