sus-fixtures-async-http 0.1.2 → 0.2.1
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 +15 -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: 0c8b4b99f53935f502d96d9cf37cb6a99c9a3c0b1ee7afad25702b3b94f036ff
|
4
|
+
data.tar.gz: e9cf0f0726d1b7743394b024755a4d1c011e7a2836ad5da4058f35256ea212c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66bb0b27db5c87a265aa4a0e1605ab1786fbb717745054e5f2a65ee78481cee219e0901f7e47862fd8e080e726698f71bb3d66da2330b61794bc42a0f80aa7f
|
7
|
+
data.tar.gz: 75b7467bd9e9add88eb998f860e6443c42ad3d1c6f0a6dddf679517cd61f116729fc36229004c570056763ce7ed22a322a8e70a6a2e55850d6e8d07317553884
|
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
|
@@ -42,9 +44,14 @@ module Sus::Fixtures
|
|
42
44
|
@client
|
43
45
|
end
|
44
46
|
|
47
|
+
def client_endpoint
|
48
|
+
@client_endpoint
|
49
|
+
end
|
50
|
+
|
45
51
|
def before
|
46
52
|
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
|
47
53
|
@bound_endpoint = ::Async::IO::SharedEndpoint.bound(endpoint)
|
54
|
+
@client_endpoint = @bound_endpoint.local_address_endpoint
|
48
55
|
|
49
56
|
# I feel a dedicated class might be better than this hack:
|
50
57
|
mock(@bound_endpoint) do |mock|
|
@@ -52,11 +59,17 @@ module Sus::Fixtures
|
|
52
59
|
mock.replace(:scheme) {endpoint.scheme}
|
53
60
|
end
|
54
61
|
|
62
|
+
mock(@client_endpoint) do |mock|
|
63
|
+
mock.replace(:protocol) {endpoint.protocol}
|
64
|
+
mock.replace(:scheme) {endpoint.scheme}
|
65
|
+
mock.replace(:authority) {endpoint.authority}
|
66
|
+
end
|
67
|
+
|
55
68
|
@server_task = Async do
|
56
69
|
server.run
|
57
70
|
end
|
58
71
|
|
59
|
-
@client = ::Async::HTTP::Client.new(
|
72
|
+
@client = ::Async::HTTP::Client.new(@client_endpoint, protocol: endpoint.protocol, retries: retries)
|
60
73
|
end
|
61
74
|
|
62
75
|
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.2.1
|
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
|