Skip to content

Commit

Permalink
Remove personal website from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 15, 2024
1 parent cac8973 commit 8bbf377
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 44 deletions.
42 changes: 0 additions & 42 deletions test/async/http/client/codeotaku.rb

This file was deleted.

18 changes: 18 additions & 0 deletions test/async/http/client/google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require 'async/http/client'
require 'async/http/endpoint'

require 'protocol/http/accept_encoding'

require 'sus/fixtures/async'

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

it "should specify a hostname" do
expect(endpoint.hostname).to be == "www.google.com"
expect(client.authority).to be == "www.google.com"
end

it 'can fetch remote resource' do
response = client.get('/', 'accept' => '*/*')

Expand All @@ -23,4 +30,15 @@

client.close
end

it "can request remote resource with compression" do
compressor = Protocol::HTTP::AcceptEncoding.new(client)

response = compressor.get("/", {'accept-encoding' => 'gzip'})

expect(response).to be(:success?)

expect(response.body).to be_a Async::HTTP::Body::Inflate
expect(response.read).to be(:start_with?, '<!doctype html>')
end
end
4 changes: 2 additions & 2 deletions test/async/http/internet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
let(:headers) {[['accept', '*/*'], ['user-agent', 'async-http']]}

it "can fetch remote website" do
response = internet.get("https://www.codeotaku.com/index", headers)
response = internet.get("https://www.google.com/", headers)

expect(response).to be(:success?)

response.close
end

it "can accept URI::HTTP objects" do
uri = URI.parse("https://www.codeotaku.com/index")
uri = URI.parse("https://www.google.com/")
response = internet.get(uri, headers)

expect(response).to be(:success?)
Expand Down

0 comments on commit 8bbf377

Please sign in to comment.