sus-fixtures-async-http 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/fixtures/async/http/server_context.rb +11 -2
- data/lib/sus/fixtures/async/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +16 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 943ec9df610ff9ca3218cb788c983691e3af8c2edeaec9d3ea43fc3e195e2772
|
4
|
+
data.tar.gz: b6c6c1f8e6563c9b47c2a79a5d9ee5ecef7df1d5ceda477a1d0df8c6a32d9d41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c742d502dc1e72d392f6755561f316a6ac2157d6420124d4ecf4575d6521069d95a1cf16474fb6a21c80bb23425b5d4f8d096e4c070db7011af99670c9157b9
|
7
|
+
data.tar.gz: 2215debc7e4e79b360a8232342fd71e8164990e219b0251f493a864bf15f2a2ed910a775b8d9be0512ceceb65dece94b640ceab8ee7947b8e72daba3f2243fe8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -14,12 +14,14 @@ module Sus::Fixtures
|
|
14
14
|
module ServerContext
|
15
15
|
include ReactorContext
|
16
16
|
|
17
|
+
def timeout = nil
|
18
|
+
|
17
19
|
def protocol
|
18
20
|
::Async::HTTP::Protocol::HTTP1
|
19
21
|
end
|
20
22
|
|
21
23
|
def endpoint
|
22
|
-
::Async::HTTP::Endpoint.parse('http://
|
24
|
+
::Async::HTTP::Endpoint.parse('http://localhost:0', timeout: 0.8, reuse_port: true, protocol: protocol)
|
23
25
|
end
|
24
26
|
|
25
27
|
def retries
|
@@ -45,6 +47,7 @@ module Sus::Fixtures
|
|
45
47
|
def before
|
46
48
|
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
|
47
49
|
@bound_endpoint = ::Async::IO::SharedEndpoint.bound(endpoint)
|
50
|
+
@address_endpoint = @bound_endpoint.local_address_endpoint
|
48
51
|
|
49
52
|
# I feel a dedicated class might be better than this hack:
|
50
53
|
mock(@bound_endpoint) do |mock|
|
@@ -52,11 +55,17 @@ module Sus::Fixtures
|
|
52
55
|
mock.replace(:scheme) {endpoint.scheme}
|
53
56
|
end
|
54
57
|
|
58
|
+
mock(@address_endpoint) do |mock|
|
59
|
+
mock.replace(:protocol) {endpoint.protocol}
|
60
|
+
mock.replace(:scheme) {endpoint.scheme}
|
61
|
+
mock.replace(:authority) {endpoint.authority}
|
62
|
+
end
|
63
|
+
|
55
64
|
@server_task = Async do
|
56
65
|
server.run
|
57
66
|
end
|
58
67
|
|
59
|
-
@client = ::Async::HTTP::Client.new(
|
68
|
+
@client = ::Async::HTTP::Client.new(@address_endpoint, protocol: endpoint.protocol, retries: retries)
|
60
69
|
end
|
61
70
|
|
62
71
|
def after
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus-fixtures-async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,8 +37,22 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2022-08-
|
40
|
+
date: 2022-08-28 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: async-io
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.34'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.34'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: sus
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|