Skip to content

Commit 105c1fc

Browse files
committed
Improve test robustness on failure case.
We don't expect a response to be generated, but if it is, close it.
1 parent bdcc2ca commit 105c1fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fixtures/async/http/a_protocol.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ module HTTP
508508

509509
it "can't get /" do
510510
expect do
511-
client.get("/")
511+
response = client.get("/")
512+
ensure
513+
response&.close
512514
end.to raise_exception(::IO::TimeoutError)
513515
end
514516
end

0 commit comments

Comments
 (0)