Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure to use bash

  • Loading branch information...
commit 1faf68986a0d5de30465ce1b06a788dd57fe6e2b 1 parent b4138dc
Hari Manikarnika & Michael Sofaer authored
Showing with 6 additions and 4 deletions.
  1. +2 −2 lib/hellspawn.rb
  2. +4 −2 test/hellspawn_test.rb
View
4 lib/hellspawn.rb
@@ -66,10 +66,10 @@ def flag_snippet
self[:flags].map{|k,v| k + " " + v.to_s}.join(" ")
end
def log_script log_dir
- "exec multilog #{log_dir}/#{self[:name]}.log"
+ "#! /bin/bash\nexec multilog #{log_dir}/#{self[:name]}.log"
end
def run_prep
- "exec 2&>1" + dir_snippet
+ "#! /bin/bash\nexec 2>&1" + dir_snippet
end
def dir_snippet
"\ncd #{self[:directory]}" if key? :directory
View
6 test/hellspawn_test.rb
@@ -30,6 +30,7 @@ def test_march
@legion.march!
run_script = File.read("#{@base}/thin/run")
assert { run_script.match /exec \/usr\/local\/bin\/thin/ }
+ assert { run_script.match /#!.*bash/ }
end
def test_legion_dir
@legion.summon @thin
@@ -57,7 +58,8 @@ def test_daemon_log_script
@legion.summon @thin
@legion.march!
run_script = File.read("#{@base}/thin/log/run")
- assert { run_script.split("\n").first == "exec multilog #{@log_dir}/thin.log" }
+ assert { run_script.match /#!.*bash/ }
+ assert { run_script.match /exec multilog #{@log_dir}\/thin.log/ }
end
def test_flags
@legion.summon @thin
@@ -74,7 +76,7 @@ def test_stderr
@legion.summon @thin
@legion.march!
run_script = File.read("#{@base}/thin/run")
- assert { run_script.split("\n").first == "exec 2&>1" }
+ assert { run_script.match /exec 2>&1/ }
end
def test_removal
@legion.summon @thin
Please sign in to comment.
Something went wrong with that request. Please try again.