diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-09 13:51:29 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-09 13:51:29 -0600 |
| commit | f42e23ad9847e11e86c77623eb77da3355b6d71b (patch) | |
| tree | 1f1cbb1c1ffe1b10f6bd188afd7ece427d8a0b96 /spec/support | |
| parent | 14c7a0e3ebf77451662bbbac1915facdec0bca3f (diff) | |
test: switch to rspec
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/server.rb | 24 |
1 files changed, 24 insertions, 0 deletions
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 |
