Skip to content

Commit 5c97180

Browse files
committed
Fix tests.
1 parent 02a33f0 commit 5c97180

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

fixtures/async/http/cache/a_general_cache.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module Async::HTTP::Cache
9494
end
9595

9696
[200, 203, 300, 301, 302, 404, 410].each do |response_code|
97-
with "cacheable response code #{response_code}" do
97+
with "cacheable response code #{response_code}", unique: "status-#{response_code}" do
9898
let(:response_code) {response_code}
9999

100100
it 'is cached' do
@@ -108,7 +108,7 @@ module Async::HTTP::Cache
108108
end
109109

110110
[202, 303, 400, 403, 500, 503].each do |response_code|
111-
with "not cacheable response code #{response_code}" do
111+
with "not cacheable response code #{response_code}", unique: "status-#{response_code}" do
112112
let(:response_code) {response_code}
113113

114114
it 'is not cached' do
@@ -132,7 +132,7 @@ module Async::HTTP::Cache
132132
let(:headers) {[['cache-control', flag]]}
133133
let(:headers_hash) {Hash[headers.map {|k, v| [k, [v]]}]}
134134

135-
with "not cacheable response #{flag}" do
135+
with "not cacheable response #{flag}", unique: flag do
136136
it 'is not cached' do
137137
responses = 2.times.map {client.get("/", {}).tap(&:finish)}
138138
response_headers = responses.map {|r| r.headers.to_h}

test/async/http/cache/general.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
body.write " "
1919
task.yield
2020
body.write "World"
21-
body.close
21+
body.close_write
2222
rescue Async::HTTP::Body::Writable::Closed
2323
# Ignore... probably head request.
2424
end
25-
25+
2626
response = Protocol::HTTP::Response[200, [['cache-control', 'max-age=1, public']], body]
27-
27+
2828
if request.head?
2929
response.body = Protocol::HTTP::Body::Head.for(response.body)
3030
end
31-
31+
3232
response
3333
end
3434
end
35-
35+
3636
let(:store) {cache.store.delegate}
37-
37+
3838
with 'client-side cache' do
3939
let(:cache) {subject.new(@client)}
4040
alias client cache

0 commit comments

Comments
 (0)