diff --git a/spec/routes_spec.moon b/spec/routes_spec.moon
index 14b7798..93a4d6e 100644
--- a/spec/routes_spec.moon
+++ b/spec/routes_spec.moon
@@ -104,24 +104,26 @@ describe "http://miti.sh/posts", ->
assert.same request\body!\match("
(.*)"), "miti.sh ยท Posts"
describe "http://git.miti.sh", ->
- it "reverse proxies request to gitea through a unix socket", ->
+ it "reverse-proxies request to a gitea unix socket", ->
Path = require "sitegen.path"
socket_fname = "unixstreamsrvr.moon"
socket_dir = "/run/gitea"
socket_owner = "nobody"
basepath = Path.basepath debug.getinfo(1).short_src
- os.execute "mkdir " .. socket_dir
- p = io.popen "moon %s"\format Path.join(basepath, socket_fname)
- os.execute "sleep 0.1"
- os.execute "chown -R " .. socket_owner .. " " .. socket_dir
+ Path.mkdir socket_dir
+ server = io.popen "moon %s"\format Path.join(basepath, socket_fname)
+ Path.exec "sleep", "0.1"
+ Path.exec "chown", "-R", socket_owner, socket_dir
result = Path.read_exec "find", socket_dir, "-type", "s", "-ls"
assert.truthy result\match "nobody%s+root.+" .. Path.join(socket_dir, "gitea.socket")
- request = req "http://git.miti.sh"
- pout = p\read"*a"
- p\close!
- assert.truthy pout\match "Host: git.miti.sh"
+ req "http://git.miti.sh"
+
+ reqheader = with server\read "*a"
+ server\close!
+
+ assert.truthy reqheader\match "Host: git.miti.sh"
describe "http://apps.miti.sh", ->
it "doesn't find it", ->