sus-fixtures-async-http 0.3.0 → 0.5.0
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 +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: a41ad323811224d46bfa1fa1bd64bb801fe3fcc6c2baae2ba9778c8ad5c2666e
|
4
|
+
data.tar.gz: 99f04ff7ef291253878b565bc7ce96bb16d6bddb05c482c56fcab80db7ecaaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4368d65fe89f46c66edcd4ea75dfab615880b1910dce9d3a761337bf8510db10ffa0a78d2693096f088f77389af15956c835f7657aedac02bdc655d7ac89b12
|
7
|
+
data.tar.gz: 181d72bdc9e30a058c1dbe71e2309a63e1f60b42ce5d21e66a23da3d5a4a5416872910f8eb577089c3c14abb4571a934e326e07d6f448ac610430b8a5cb5440c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -65,8 +65,16 @@ module Sus::Fixtures
|
|
65
65
|
app
|
66
66
|
end
|
67
67
|
|
68
|
+
def make_server_endpoint(bound_endpoint)
|
69
|
+
bound_endpoint
|
70
|
+
end
|
71
|
+
|
72
|
+
def make_server(endpoint)
|
73
|
+
::Async::HTTP::Server.new(middleware, endpoint)
|
74
|
+
end
|
75
|
+
|
68
76
|
def server
|
69
|
-
|
77
|
+
@server
|
70
78
|
end
|
71
79
|
|
72
80
|
def client
|
@@ -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.5.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
|