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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd3f410d2f916037112c74ffc5b4c84f60f1c88412e8d0bf687667cc6c005a82
4
- data.tar.gz: cc7177359a1732b55cbbb6ecb67d2b0f83de0b288a5dafe501b05e71f484f506
3
+ metadata.gz: a41ad323811224d46bfa1fa1bd64bb801fe3fcc6c2baae2ba9778c8ad5c2666e
4
+ data.tar.gz: 99f04ff7ef291253878b565bc7ce96bb16d6bddb05c482c56fcab80db7ecaaae
5
5
  SHA512:
6
- metadata.gz: 7f80fed8f250fb0068320ccdb4127c53ccaab56b837123636b858abfcd64273fd0c9e27e55b7be77f2c787894f84e88517568f438a4d82f425288f3f6411cda3
7
- data.tar.gz: 5a6e3d62afe002b99ab2921ed157733fbd1353b865b9d066ec1c606a4d92c0dd6e03d6e3f01352a0d50f1d6fa2d0e4ae4ef77b8a84c7f77bcd808d619a83b8ed
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
- ::Async::HTTP::Server.new(middleware, @bound_endpoint)
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
- # I feel a dedicated class might be better than this hack:
88
- mock(@bound_endpoint) do |mock|
89
- mock.replace(:protocol) {endpoint.protocol}
90
- mock.replace(:scheme) {endpoint.scheme}
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
- mock(@client_endpoint) do |mock|
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, protocol: endpoint.protocol, retries: retries)
121
+ @client = ::Async::HTTP::Client.new(@client_endpoint, retries: retries)
105
122
  end
106
123
 
107
124
  def after
@@ -7,7 +7,7 @@ module Sus
7
7
  module Fixtures
8
8
  module Async
9
9
  module HTTP
10
- VERSION = "0.3.0"
10
+ VERSION = "0.5.0"
11
11
  end
12
12
  end
13
13
  end
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.3.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-02-10 00:00:00.000000000 Z
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/ioquatix/sus-fixtures-async
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.6
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