Boots up test servers so integration tests can connect to them (when running in the same process try webmock) … works for RSpec and Minitest (with minitest-around/maxitest or similar gem)
The server boot takes about 5 seconds, might be better with a different web-server, but WEBrick is simplest.
Code from this post is now the stub_server gem.
require 'stub_server' describe 'CLI' do let(:service_a_replies) {{'/v1/catalog/services' => {}}} let(:service_b_replies) {{'/api/v1/nodes' => {}}} around do |test| StubServer.open(8500, service_a_replies) do |a| StubServer.open(9000, service_b_replies) do |b| a.wait b.wait test.call end end end it "works" do ... end end