1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require "async/http/server"
require "async/http/endpoint"
require "sus/fixtures/async"
describe Async::HTTP::Server do
include Sus::Fixtures::Async::ReactorContext
let(:endpoint) {Async::HTTP::Endpoint.parse("http://localhost:0")}
let(:app) {Protocol::HTTP::Middleware::Okay}
let(:server) {subject.new(app, endpoint)}
with "#run" do
it "runs the server" do
task = server.run
expect(task).to be_a(Async::Task)
task.stop
end
end
end
|