summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/test11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/test b/bin/test
index 79fe939..be8878b 100755
--- a/bin/test
+++ b/bin/test
@@ -9,10 +9,15 @@ gemfile do
gem "net-hippie", "~> 1.0"
end
-pid = Process.spawn("mise exec -- cargo run")
+$bind_addr = ENV.fetch("BIND_ADDR", "127.0.0.1:7878")
+
+pid = Process.spawn({
+ "BIND_ADDR" => $bind_addr
+}, "mise exec -- cargo run")
sleep 1
at_exit do
+ Process.kill('SIGTERM', pid)
system("killall sts")
end
@@ -22,7 +27,7 @@ class ServerTest < Minitest::Test
attr_reader :base_url, :client
def setup
- @base_url = "http://127.0.0.1:7878"
+ @base_url = "http://#{$bind_addr}"
@client = Net::Hippie::Client.new
end
@@ -40,7 +45,7 @@ class ServerTest < Minitest::Test
def test_metadata
response = client.get(base_url + "/.well-known/oauth-authorization-server")
assert_equal "200", response.code
- # assert_equal "application/json", response["Content-Type"]
+ assert_equal "application/json", response["Content-Type"]
end
# /token - Token endpoint https://datatracker.ietf.org/doc/html/rfc8693#section-2.3