Permalink
Browse files

Use array arguments to Open4.popen4.

  • Loading branch information...
1 parent 8d1227b commit 0ccfbe485ef63249e3c7cabe4edc62c25f1fbff2 @danp danp committed Jan 1, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 tests/test_helper.rb
View
@@ -68,12 +68,13 @@ def rackup_path(*parts)
def with_rackup(name)
GC.disable
- pid, w, r, e = Open4.popen4("rackup #{rackup_path(name)}")
- until e.gets =~ /HTTPServer#start:/; end
+ pid, w, r, e = Open4.popen4("rackup", rackup_path(name))
+ until e.gets.tap {|x| puts x if x } =~ /HTTPServer#start:/; end
yield
ensure
GC.enable
Process.kill(9, pid)
+ Process.wait(pid)
end
def server_path(*parts)
@@ -83,9 +84,10 @@ def server_path(*parts)
def with_server(name)
GC.disable
pid, w, r, e = Open4.popen4(server_path("#{name}.rb"))
- until e.gets =~ /ready/; end
+ until e.gets.tap {|x| puts x if x } =~ /ready/; end
yield
ensure
GC.enable
Process.kill(9, pid)
+ Process.wait(pid)
end

0 comments on commit 0ccfbe4

Please sign in to comment.