Skip to content

Commit 24dc0aa

Browse files
committed
Remove personal website from tests.
1 parent cac8973 commit 24dc0aa

File tree

2 files changed

+18
-42
lines changed

2 files changed

+18
-42
lines changed

test/async/http/client/codeotaku.rb

-42
This file was deleted.

test/async/http/client/google.rb

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
require 'async/http/client'
77
require 'async/http/endpoint'
88

9+
require 'protocol/http/accept_encoding'
10+
911
require 'sus/fixtures/async'
1012

1113
describe Async::HTTP::Client do
@@ -14,6 +16,11 @@
1416
let(:endpoint) {Async::HTTP::Endpoint.parse('https://www.google.com')}
1517
let(:client) {Async::HTTP::Client.new(endpoint)}
1618

19+
it "should specify a hostname" do
20+
expect(endpoint.hostname).to be == "www.google.com"
21+
expect(client.authority).to be == "www.google.com"
22+
end
23+
1724
it 'can fetch remote resource' do
1825
response = client.get('/', 'accept' => '*/*')
1926

@@ -23,4 +30,15 @@
2330

2431
client.close
2532
end
33+
34+
it "can request remote resource with compression" do
35+
compressor = Protocol::HTTP::AcceptEncoding.new(client)
36+
37+
response = compressor.get("/", {'accept-encoding' => 'gzip'})
38+
39+
expect(response).to be(:success?)
40+
41+
expect(response.body).to be_a Async::HTTP::Body::Inflate
42+
expect(response.read).to be(:start_with?, '<!doctype html>')
43+
end
2644
end

0 commit comments

Comments
 (0)