Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Blow away services dir before writing out new scripts

  • Loading branch information...
commit d962ca8402d51b1018e8a073cd0edb7a5079f4f2 1 parent 9d2c950
Michael Sofaer and Raphael Sofaer authored
Showing with 8 additions and 1 deletion.
  1. +2 −1  lib/hellspawn.rb
  2. +6 −0 test/hellspawn_test.rb
View
3  lib/hellspawn.rb
@@ -7,13 +7,14 @@ def initialize(options)
@options = options
end
def march!
- #slaughter_stragglers!
+ FileUtils.rm_rf(@options[:base])
each {|daemon| daemon.march!(@options[:base])}
end
def summon(options)
self << Daemon.new(options)
end
+
class Daemon < Hash
def initialize(options)
replace options
View
6 test/hellspawn_test.rb
@@ -39,4 +39,10 @@ def test_stderr
run_script = File.read("/tmp/test_services/thin/run")
assert { run_script.split("\n").first == "exec 2&>1" }
end
+ def test_removal
+ @legion.summon @thin
+ @legion.march!
+ Hellspawn.legion(:base => "/tmp/test_services", :name => "empty_legion").march!
+ assert {Dir.glob("/tmp/test_services/*") == [] }
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.