Skip to content

Commit b70af59

Browse files
committed
Minor reorganisation of server context.
1 parent 48bd08d commit b70af59

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/async/http/server_context.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
end
3939

4040
before do
41-
@client = Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol, retries: retries)
42-
4341
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
4442
@bound_endpoint = Async::IO::SharedEndpoint.bound(endpoint)
4543

@@ -50,12 +48,14 @@
5048
@server_task = Async do
5149
server.run
5250
end
51+
52+
@client = Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol, retries: retries)
5353
end
5454

5555
after do
56-
@client.close
57-
@server_task.stop
58-
@bound_endpoint.close
56+
@client&.close
57+
@server_task&.stop
58+
@bound_endpoint&.close
5959
end
6060

6161
let(:client) {@client}

0 commit comments

Comments
 (0)