sus-fixtures-async-http 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/fixtures/async/http/server_context.rb +31 -14
- data/lib/sus/fixtures/async/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: 37b083cf427b4788520de2955f48e1ce9025a361f3e5c92aaf534fb455db47b8
|
4
|
+
data.tar.gz: a0afbc0322271a71d7ca8c2ae916fb3591db006b3614991e4f850262c6a362fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7634e13a74f666d2e6f7e360d204471a7dcc83bbd412cd00ee33110be84038f8f582ba3f2dec28f80e5355c1f8e10d3fcb082ff6a4856078093c23ec6820676
|
7
|
+
data.tar.gz: 35526b7e3c8f7260dafa66d0da738253cf5945b23fd950633525f8beb411070871c60ec9b4f034564ec6c4c9d1ee02b146d96b2f8f4e107cd22b0dab043d7378
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -65,10 +65,18 @@ module Sus::Fixtures
|
|
65
65
|
app
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
68
|
+
def make_server_endpoint(bound_endpoint)
|
69
|
+
bound_endpoint
|
70
|
+
end
|
71
|
+
|
72
|
+
def make_server(endpoint)
|
69
73
|
::Async::HTTP::Server.new(middleware, @bound_endpoint)
|
70
74
|
end
|
71
75
|
|
76
|
+
def server
|
77
|
+
@server
|
78
|
+
end
|
79
|
+
|
72
80
|
def client
|
73
81
|
@client
|
74
82
|
end
|
@@ -77,31 +85,40 @@ module Sus::Fixtures
|
|
77
85
|
@client_endpoint
|
78
86
|
end
|
79
87
|
|
88
|
+
def make_client_endpoint(bound_endpoint)
|
89
|
+
bound_endpoint.local_address_endpoint
|
90
|
+
end
|
91
|
+
|
92
|
+
|
80
93
|
def before
|
81
94
|
super
|
82
95
|
|
83
96
|
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
|
84
97
|
@bound_endpoint = ::Async::IO::SharedEndpoint.bound(endpoint)
|
85
|
-
@client_endpoint = @bound_endpoint.local_address_endpoint
|
86
98
|
|
87
|
-
|
88
|
-
mock(@
|
89
|
-
|
90
|
-
|
99
|
+
@server_endpoint = make_server_endpoint(@bound_endpoint)
|
100
|
+
mock(@server_endpoint) do |wrapper|
|
101
|
+
wrapper.replace(:protocol) {endpoint.protocol}
|
102
|
+
wrapper.replace(:scheme) {endpoint.scheme}
|
103
|
+
wrapper.replace(:authority) {endpoint.authority}
|
104
|
+
wrapper.replace(:path) {endpoint.path}
|
91
105
|
end
|
92
106
|
|
93
|
-
|
94
|
-
mock.replace(:protocol) {endpoint.protocol}
|
95
|
-
mock.replace(:scheme) {endpoint.scheme}
|
96
|
-
mock.replace(:authority) {endpoint.authority}
|
97
|
-
mock.replace(:path) {endpoint.path}
|
98
|
-
end
|
107
|
+
@server = make_server(@server_endpoint)
|
99
108
|
|
100
109
|
@server_task = Async do
|
101
|
-
server.run
|
110
|
+
@server.run
|
111
|
+
end
|
112
|
+
|
113
|
+
@client_endpoint = make_client_endpoint(@bound_endpoint)
|
114
|
+
mock(@client_endpoint) do |wrapper|
|
115
|
+
wrapper.replace(:protocol) {endpoint.protocol}
|
116
|
+
wrapper.replace(:scheme) {endpoint.scheme}
|
117
|
+
wrapper.replace(:authority) {endpoint.authority}
|
118
|
+
wrapper.replace(:path) {endpoint.path}
|
102
119
|
end
|
103
120
|
|
104
|
-
@client = ::Async::HTTP::Client.new(@client_endpoint,
|
121
|
+
@client = ::Async::HTTP::Client.new(@client_endpoint, retries: retries)
|
105
122
|
end
|
106
123
|
|
107
124
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2023-
|
40
|
+
date: 2023-09-10 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async-http
|
@@ -120,7 +120,7 @@ files:
|
|
120
120
|
- lib/sus/fixtures/async/http/version.rb
|
121
121
|
- license.md
|
122
122
|
- readme.md
|
123
|
-
homepage: https://github.com/
|
123
|
+
homepage: https://github.com/socketry/sus-fixtures-async-http
|
124
124
|
licenses:
|
125
125
|
- MIT
|
126
126
|
metadata:
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.4.
|
143
|
+
rubygems_version: 3.4.10
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Test fixtures for running in Async::HTTP.
|
metadata.gz.sig
CHANGED
Binary file
|