From f42e23ad9847e11e86c77623eb77da3355b6d71b Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 9 Jun 2025 13:51:29 -0600 Subject: test: switch to rspec --- spec/support/server.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/support/server.rb (limited to 'spec/support/server.rb') diff --git a/spec/support/server.rb b/spec/support/server.rb new file mode 100644 index 0000000..2fea6af --- /dev/null +++ b/spec/support/server.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +RSpec.configure do |config| + config.add_setting :bind_addr + config.bind_addr = ENV.fetch("BIND_ADDR", "127.0.0.1:7878") + + config.add_setting :pid + + config.before :suite do + RSpec.configuration.pid = Process.spawn({ + "BIND_ADDR" => RSpec.configuration.bind_addr, + }, "mise exec -- cargo run") + sleep 1 + end + + config.after :suite do + Process.kill('SIGTERM', RSpec.configuration.pid) + system("killall sts") + end +end + +at_exit do + system("killall sts") +end -- cgit v1.2.3