Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use array arguments to Open4.popen4.

  • Loading branch information...
commit 0ccfbe485ef63249e3c7cabe4edc62c25f1fbff2 1 parent 8d1227b
@dpiddy dpiddy authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 tests/test_helper.rb
View
8 tests/test_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.