webmock 3.25.1 → 3.26.2
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 +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +5 -0
- data/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +1 -1
- data/lib/webmock/http_lib_adapters/curb_adapter.rb +4 -3
- data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +0 -2
- data/lib/webmock/http_lib_adapters/http_rb/response.rb +11 -3
- data/lib/webmock/http_lib_adapters/http_rb/streamer.rb +12 -5
- data/lib/webmock/http_lib_adapters/http_rb/webmock.rb +4 -1
- data/lib/webmock/http_lib_adapters/net_http.rb +2 -2
- data/lib/webmock/request_pattern.rb +3 -3
- data/lib/webmock/version.rb +1 -1
- metadata +6 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d61b9a1ba2457ef06a173ec71523bedaaecdac935b59611abeff105679da7cb3
|
|
4
|
+
data.tar.gz: 1d78e1c3b493bd1fc2af0961a6bebae5a273e1937b6cad6aaa7ef501e4b70778
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e56c8868b81ac1465e6b28b96041f9ea0a3cda7ef3728d0bc6715215d84baa44af5b5e1f4ba48597f34e6fd2e6f00f86cb5d61c194fb2eebd0a58caf92f615b
|
|
7
|
+
data.tar.gz: ea6072e9d1dbba86925558f31e10df790c5979f470806b92be7cfa483d47b1158ba55b1453981d696751ca2b2c98a1847f50cb635779a7eef7e7a377598777b4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
# 3.26.2
|
|
4
|
+
|
|
5
|
+
* Add support to parse http/2 request on curb adapter
|
|
6
|
+
|
|
7
|
+
Thanks to [Christoph Rieß](https://github.com/criess)
|
|
8
|
+
|
|
9
|
+
* CurbAdapter alias `code` from `response_code`
|
|
10
|
+
|
|
11
|
+
Thanks to [Christoph Rieß](https://github.com/criess)
|
|
12
|
+
|
|
13
|
+
* Add HTTP.rb v6.0.0 compatibility to http_rb adapter
|
|
14
|
+
|
|
15
|
+
Thanks to [Erik Berlin](https://github.com/sferik)
|
|
16
|
+
|
|
17
|
+
# 3.26.1
|
|
18
|
+
|
|
19
|
+
* Fix compatibility with recent async-http versions
|
|
20
|
+
|
|
21
|
+
Thanks to [Mikhail Doronin](https://github.com/misdoro)
|
|
22
|
+
|
|
23
|
+
# 3.26.0
|
|
24
|
+
|
|
25
|
+
* Support Addressable::URI in request patterns
|
|
26
|
+
|
|
27
|
+
Thanks to [Alexey Zapparov](https://github.com/ixti)
|
|
28
|
+
|
|
29
|
+
# 3.25.2
|
|
30
|
+
|
|
31
|
+
* Return support for `em_http_request`
|
|
32
|
+
|
|
33
|
+
Thanks to [Oleg](https://github.com/Koilanetroc)
|
|
34
|
+
|
|
3
35
|
# 3.25.1
|
|
4
36
|
|
|
5
37
|
* Fix FrozenError in Typhoeus streaming response body
|
data/README.md
CHANGED
|
@@ -45,6 +45,7 @@ Supported Ruby Interpreters
|
|
|
45
45
|
* MRI 3.2
|
|
46
46
|
* MRI 3.3
|
|
47
47
|
* MRI 3.4
|
|
48
|
+
* MRI 4.0
|
|
48
49
|
* JRuby
|
|
49
50
|
|
|
50
51
|
## Installation
|
|
@@ -1208,6 +1209,10 @@ People who submitted patches and new features or suggested improvements. Many th
|
|
|
1208
1209
|
* Christian Schmidt
|
|
1209
1210
|
* Rodrigo Argumedo
|
|
1210
1211
|
* Patrick Jaberg
|
|
1212
|
+
* Oleg
|
|
1213
|
+
* Mikhail Doronin
|
|
1214
|
+
* Christoph Rieß
|
|
1215
|
+
* Erik Berlin
|
|
1211
1216
|
|
|
1212
1217
|
For a full list of contributors you can visit the
|
|
1213
1218
|
[contributors](https://github.com/bblimke/webmock/contributors) page.
|
|
@@ -211,7 +211,7 @@ if defined?(Async::HTTP)
|
|
|
211
211
|
def build_response(webmock_response)
|
|
212
212
|
headers = (webmock_response.headers || {}).each_with_object([]) do |(k, value), o|
|
|
213
213
|
Array(value).each do |v|
|
|
214
|
-
o.push [k, v]
|
|
214
|
+
o.push [k, v] unless k.downcase == 'content-length' # async-http appends the exact content-length automatically
|
|
215
215
|
end
|
|
216
216
|
end
|
|
217
217
|
|
|
@@ -7,7 +7,7 @@ rescue LoadError
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
if defined?(Curl)
|
|
10
|
-
WebMock::VersionChecker.new('Curb', Curl::CURB_VERSION, '0.7.16', '1.
|
|
10
|
+
WebMock::VersionChecker.new('Curb', Curl::CURB_VERSION, '0.7.16', '1.2.2', ['0.8.7']).check_version!
|
|
11
11
|
|
|
12
12
|
module WebMock
|
|
13
13
|
module HttpLibAdapters
|
|
@@ -32,8 +32,8 @@ if defined?(Curl)
|
|
|
32
32
|
status, headers = nil, {}
|
|
33
33
|
|
|
34
34
|
header_string.split(/\r\n/).each do |header|
|
|
35
|
-
if header =~ %r
|
|
36
|
-
status = $
|
|
35
|
+
if header =~ %r{\AHTTP/(1\.[01]|2) (\d{3})\s*(.*)}
|
|
36
|
+
status = $3
|
|
37
37
|
else
|
|
38
38
|
parts = header.split(':', 2)
|
|
39
39
|
unless parts.empty?
|
|
@@ -313,6 +313,7 @@ if defined?(Curl)
|
|
|
313
313
|
def response_code
|
|
314
314
|
@response_code ||= super
|
|
315
315
|
end
|
|
316
|
+
alias code response_code
|
|
316
317
|
|
|
317
318
|
def header_str
|
|
318
319
|
@header_str ||= super
|
|
@@ -28,9 +28,6 @@ module HTTP
|
|
|
28
28
|
headers = webmock_response.headers || {}
|
|
29
29
|
uri = normalize_uri(request_signature && request_signature.uri)
|
|
30
30
|
|
|
31
|
-
# HTTP.rb 3.0+ uses a keyword argument to pass the encoding, but 1.x
|
|
32
|
-
# and 2.x use a positional argument, and 0.x don't support supplying
|
|
33
|
-
# the encoding.
|
|
34
31
|
body = build_http_rb_response_body_from_webmock_response(webmock_response)
|
|
35
32
|
|
|
36
33
|
return new(status, "1.1", headers, body, uri) if HTTP::VERSION < "1.0.0"
|
|
@@ -46,6 +43,17 @@ module HTTP
|
|
|
46
43
|
})
|
|
47
44
|
end
|
|
48
45
|
|
|
46
|
+
# 6.0.0 changed Response.new from a positional hash to keyword arguments.
|
|
47
|
+
if HTTP::VERSION >= '6.0.0'
|
|
48
|
+
return new(
|
|
49
|
+
status: status,
|
|
50
|
+
version: "1.1",
|
|
51
|
+
headers: headers,
|
|
52
|
+
body: body,
|
|
53
|
+
request: request,
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
49
57
|
new({
|
|
50
58
|
status: status,
|
|
51
59
|
version: "1.1",
|
|
@@ -10,15 +10,22 @@ module HTTP
|
|
|
10
10
|
|
|
11
11
|
def readpartial(size = nil, outbuf = nil)
|
|
12
12
|
unless size
|
|
13
|
-
if defined?(HTTP::
|
|
14
|
-
size = HTTP::Client::BUFFER_SIZE
|
|
15
|
-
elsif defined?(HTTP::Connection::BUFFER_SIZE)
|
|
13
|
+
if defined?(HTTP::Connection::BUFFER_SIZE)
|
|
16
14
|
size = HTTP::Connection::BUFFER_SIZE
|
|
15
|
+
elsif defined?(HTTP::Client::BUFFER_SIZE)
|
|
16
|
+
size = HTTP::Client::BUFFER_SIZE
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
chunk = @io.read
|
|
21
|
-
|
|
20
|
+
chunk = @io.read(size, outbuf)
|
|
21
|
+
|
|
22
|
+
# HTTP.rb 6.0+ expects EOFError at end-of-stream instead of nil
|
|
23
|
+
if chunk.nil?
|
|
24
|
+
raise EOFError if HTTP::VERSION >= "6.0.0"
|
|
25
|
+
return nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
chunk.force_encoding(@encoding)
|
|
22
29
|
end
|
|
23
30
|
|
|
24
31
|
def close
|
|
@@ -43,7 +43,10 @@ module HTTP
|
|
|
43
43
|
invoke_callbacks(webmock_response, real_request: false)
|
|
44
44
|
response = ::HTTP::Response.from_webmock @request, webmock_response, request_signature
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
# HTTP.rb 6.0+ wraps responses in reverse feature order
|
|
47
|
+
features = @options.features.values
|
|
48
|
+
features = features.reverse if HTTP::VERSION >= "6.0.0"
|
|
49
|
+
features.each { |feature| response = feature.wrap_response(response) }
|
|
47
50
|
response
|
|
48
51
|
end
|
|
49
52
|
|
|
@@ -200,9 +200,9 @@ module WebMock
|
|
|
200
200
|
|
|
201
201
|
|
|
202
202
|
def check_right_http_connection
|
|
203
|
-
unless @@
|
|
203
|
+
unless @@already_checked_for_right_http_connection ||= false
|
|
204
204
|
WebMock::NetHTTPUtility.puts_warning_for_right_http_if_needed
|
|
205
|
-
@@
|
|
205
|
+
@@already_checked_for_right_http_connection = true
|
|
206
206
|
end
|
|
207
207
|
end
|
|
208
208
|
end
|
|
@@ -86,10 +86,10 @@ module WebMock
|
|
|
86
86
|
URICallablePattern.new(uri)
|
|
87
87
|
elsif uri.is_a?(::URI::Generic)
|
|
88
88
|
URIStringPattern.new(uri.to_s)
|
|
89
|
-
elsif uri.
|
|
90
|
-
URIStringPattern.new(uri)
|
|
89
|
+
elsif uri.respond_to?(:to_str)
|
|
90
|
+
URIStringPattern.new(uri.to_str)
|
|
91
91
|
else
|
|
92
|
-
raise ArgumentError.new("URI should be a String, Regexp, Addressable::Template
|
|
92
|
+
raise ArgumentError.new("URI should be a String, Regexp, Addressable::Template, a callable object, or respond to #to_str. Got: #{uri.class}")
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
95
|
end
|
data/lib/webmock/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: webmock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.26.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bartosz Blimke
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: addressable
|
|
@@ -198,20 +197,6 @@ dependencies:
|
|
|
198
197
|
- - ">="
|
|
199
198
|
- !ruby/object:Gem::Version
|
|
200
199
|
version: 2.2.4
|
|
201
|
-
- !ruby/object:Gem::Dependency
|
|
202
|
-
name: mutex_m
|
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
|
204
|
-
requirements:
|
|
205
|
-
- - ">="
|
|
206
|
-
- !ruby/object:Gem::Version
|
|
207
|
-
version: '0'
|
|
208
|
-
type: :development
|
|
209
|
-
prerelease: false
|
|
210
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
211
|
-
requirements:
|
|
212
|
-
- - ">="
|
|
213
|
-
- !ruby/object:Gem::Version
|
|
214
|
-
version: '0'
|
|
215
200
|
- !ruby/object:Gem::Dependency
|
|
216
201
|
name: excon
|
|
217
202
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -373,11 +358,10 @@ licenses:
|
|
|
373
358
|
- MIT
|
|
374
359
|
metadata:
|
|
375
360
|
bug_tracker_uri: https://github.com/bblimke/webmock/issues
|
|
376
|
-
changelog_uri: https://github.com/bblimke/webmock/blob/v3.
|
|
377
|
-
documentation_uri: https://www.rubydoc.info/gems/webmock/3.
|
|
378
|
-
source_code_uri: https://github.com/bblimke/webmock/tree/v3.
|
|
361
|
+
changelog_uri: https://github.com/bblimke/webmock/blob/v3.26.2/CHANGELOG.md
|
|
362
|
+
documentation_uri: https://www.rubydoc.info/gems/webmock/3.26.2
|
|
363
|
+
source_code_uri: https://github.com/bblimke/webmock/tree/v3.26.2
|
|
379
364
|
wiki_uri: https://github.com/bblimke/webmock/wiki
|
|
380
|
-
post_install_message:
|
|
381
365
|
rdoc_options: []
|
|
382
366
|
require_paths:
|
|
383
367
|
- lib
|
|
@@ -392,8 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
392
376
|
- !ruby/object:Gem::Version
|
|
393
377
|
version: '0'
|
|
394
378
|
requirements: []
|
|
395
|
-
rubygems_version:
|
|
396
|
-
signing_key:
|
|
379
|
+
rubygems_version: 4.1.0.dev
|
|
397
380
|
specification_version: 4
|
|
398
381
|
summary: Library for stubbing HTTP requests in Ruby.
|
|
399
382
|
test_files: []
|