sus-fixtures-async-http 0.1.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c4568feda15d16a682baae23527d0cfde7a9a1d95c50b5a19796d7bf13c81e4
4
- data.tar.gz: 78b17af438acaddcb8e0f1dbbfcd10071ae6d7335402eab80f3b0db708ed542d
3
+ metadata.gz: ee6d8ef3cde95bed688b17080244dbe31c1384ae130d48d3fb7bf4b3e2c5530a
4
+ data.tar.gz: 8bf80d2f089462c073e3f35c50b72471e4b4935c89e3f3624c0a1c40e238dd5e
5
5
  SHA512:
6
- metadata.gz: f837069655f254e1c39f39207b43b8f5a7b6ea783b4f4c2b5ebde1d55fb8d6a1b5cf6fc1c21d764b99cc323340b49d6bdcc77726983498e7c3d11d624f14e4ae
7
- data.tar.gz: bb78cb2f2d7ee560f67a2db190718f8e10c507de8aa5faa2d2612df2f888fac82d893f08fb2d572a0f4b30ae02216cf02ce5ac0502bb4a0fb52ed5face36aa56
6
+ metadata.gz: a24cec244482e9fbe9c93124dd55ffeb4140e6d13f718262730ec6d4cef12e20f0ea1640ad9d1eef5162620dce5504623a89bac3f2f9b3ff62ed63aaefc02ff4
7
+ data.tar.gz: 8005a829cd3c68dc6ee738fb48d8eced10daeec3716612ca50f5126ec1efbc09521a95dc54173e2b93cf6797d85aebe6f7b2be5f94f3f57885b43f059c2dad79
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://127.0.0.1:9294', timeout: 0.8, reuse_port: true, protocol: protocol)
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
+ @address_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(endpoint, protocol: endpoint.protocol, retries: retries)
72
+ @client = ::Async::HTTP::Client.new(@client_endpoint, protocol: endpoint.protocol, retries: retries)
60
73
  end
61
74
 
62
75
  def after
@@ -6,7 +6,7 @@ require 'sus/fixtures'
6
6
  module Sus::Fixtures
7
7
  module Async
8
8
  module HTTP
9
- VERSION = "0.1.1"
9
+ VERSION = "0.2.0"
10
10
  end
11
11
  end
12
12
  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.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,22 +37,36 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2022-08-25 00:00:00.000000000 Z
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
45
59
  requirements:
46
60
  - - "~>"
47
61
  - !ruby/object:Gem::Version
48
- version: 0.10.1
62
+ version: '0.10'
49
63
  type: :runtime
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: 0.10.1
69
+ version: '0.10'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: sus-fixtures-async
58
72
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file