sus-fixtures-async-http 0.1.2 → 0.2.1

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: 6b93f20fb3e1d138b73548e673e89ff71dceb92e00a964154fcae10a4ca8a181
4
- data.tar.gz: baed71d2711288479e45e0c3a8b4cd437a18502c00a033ccc4b9714230c4ab2d
3
+ metadata.gz: 0c8b4b99f53935f502d96d9cf37cb6a99c9a3c0b1ee7afad25702b3b94f036ff
4
+ data.tar.gz: e9cf0f0726d1b7743394b024755a4d1c011e7a2836ad5da4058f35256ea212c5
5
5
  SHA512:
6
- metadata.gz: 0b98c9e4d17272ad18e7079dcc4e4c291e0e3351332a60c7f5ced88ca57a77766b6060c3645dabbcf348dcd6013e6fed0e1fe09dfc5139e6228f3f327bd49436
7
- data.tar.gz: '00768653165926ebf406311c3a2b7c45c30c4f6796920af70255959727d01b502e7b3955215f6e519450a0586745406a1f19638f49a001fe62d5d868e1dc4b24'
6
+ metadata.gz: c66bb0b27db5c87a265aa4a0e1605ab1786fbb717745054e5f2a65ee78481cee219e0901f7e47862fd8e080e726698f71bb3d66da2330b61794bc42a0f80aa7f
7
+ data.tar.gz: 75b7467bd9e9add88eb998f860e6443c42ad3d1c6f0a6dddf679517cd61f116729fc36229004c570056763ce7ed22a322a8e70a6a2e55850d6e8d07317553884
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
+ @client_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.2"
9
+ VERSION = "0.2.1"
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.2.1
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