sus-fixtures-async-http 0.1.2 → 0.1.3

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: 6b93f20fb3e1d138b73548e673e89ff71dceb92e00a964154fcae10a4ca8a181
4
- data.tar.gz: baed71d2711288479e45e0c3a8b4cd437a18502c00a033ccc4b9714230c4ab2d
3
+ metadata.gz: 943ec9df610ff9ca3218cb788c983691e3af8c2edeaec9d3ea43fc3e195e2772
4
+ data.tar.gz: b6c6c1f8e6563c9b47c2a79a5d9ee5ecef7df1d5ceda477a1d0df8c6a32d9d41
5
5
  SHA512:
6
- metadata.gz: 0b98c9e4d17272ad18e7079dcc4e4c291e0e3351332a60c7f5ced88ca57a77766b6060c3645dabbcf348dcd6013e6fed0e1fe09dfc5139e6228f3f327bd49436
7
- data.tar.gz: '00768653165926ebf406311c3a2b7c45c30c4f6796920af70255959727d01b502e7b3955215f6e519450a0586745406a1f19638f49a001fe62d5d868e1dc4b24'
6
+ metadata.gz: 4c742d502dc1e72d392f6755561f316a6ac2157d6420124d4ecf4575d6521069d95a1cf16474fb6a21c80bb23425b5d4f8d096e4c070db7011af99670c9157b9
7
+ data.tar.gz: 2215debc7e4e79b360a8232342fd71e8164990e219b0251f493a864bf15f2a2ed910a775b8d9be0512ceceb65dece94b640ceab8ee7947b8e72daba3f2243fe8
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
@@ -45,6 +47,7 @@ module Sus::Fixtures
45
47
  def before
46
48
  # We bind the endpoint before running the server so that we know incoming connections will be accepted:
47
49
  @bound_endpoint = ::Async::IO::SharedEndpoint.bound(endpoint)
50
+ @address_endpoint = @bound_endpoint.local_address_endpoint
48
51
 
49
52
  # I feel a dedicated class might be better than this hack:
50
53
  mock(@bound_endpoint) do |mock|
@@ -52,11 +55,17 @@ module Sus::Fixtures
52
55
  mock.replace(:scheme) {endpoint.scheme}
53
56
  end
54
57
 
58
+ mock(@address_endpoint) do |mock|
59
+ mock.replace(:protocol) {endpoint.protocol}
60
+ mock.replace(:scheme) {endpoint.scheme}
61
+ mock.replace(:authority) {endpoint.authority}
62
+ end
63
+
55
64
  @server_task = Async do
56
65
  server.run
57
66
  end
58
67
 
59
- @client = ::Async::HTTP::Client.new(endpoint, protocol: endpoint.protocol, retries: retries)
68
+ @client = ::Async::HTTP::Client.new(@address_endpoint, protocol: endpoint.protocol, retries: retries)
60
69
  end
61
70
 
62
71
  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.2"
9
+ VERSION = "0.1.3"
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.2
4
+ version: 0.1.3
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-27 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
metadata.gz.sig CHANGED
Binary file