diff --git a/spec/server_spec.rb b/spec/server_spec.rb index 91c9f32d1..f173bfea4 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -108,8 +108,12 @@ expect(options.fetch(:environment)).to be_a(String) method.call(app, events, options) end - described_class.new(app_proc).boot - expect(Puma::Server).to have_received(:new) + server = described_class.new(app_proc).boot + expect(Puma::Server).to have_received(:new).with( + anything, + anything, + satisfy { |opts| opts.final_options[:Port] == server.port } + ) ensure Capybara.server = :default end