webmock 3.0.1 → 3.18.1
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 +5 -5
- data/.github/workflows/CI.yml +38 -0
- data/CHANGELOG.md +496 -2
- data/Gemfile +1 -1
- data/README.md +169 -34
- data/Rakefile +12 -4
- data/lib/webmock/api.rb +12 -0
- data/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +221 -0
- data/lib/webmock/http_lib_adapters/curb_adapter.rb +19 -5
- data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +7 -4
- data/lib/webmock/http_lib_adapters/excon_adapter.rb +5 -2
- data/lib/webmock/http_lib_adapters/http_rb/client.rb +2 -1
- data/lib/webmock/http_lib_adapters/http_rb/request.rb +7 -1
- data/lib/webmock/http_lib_adapters/http_rb/response.rb +27 -3
- data/lib/webmock/http_lib_adapters/http_rb/streamer.rb +9 -3
- data/lib/webmock/http_lib_adapters/http_rb/webmock.rb +7 -3
- data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +28 -9
- data/lib/webmock/http_lib_adapters/manticore_adapter.rb +33 -15
- data/lib/webmock/http_lib_adapters/net_http.rb +36 -89
- data/lib/webmock/http_lib_adapters/net_http_response.rb +1 -1
- data/lib/webmock/http_lib_adapters/patron_adapter.rb +4 -4
- data/lib/webmock/matchers/any_arg_matcher.rb +13 -0
- data/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
- data/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
- data/lib/webmock/matchers/hash_including_matcher.rb +4 -23
- data/lib/webmock/rack_response.rb +1 -1
- data/lib/webmock/request_body_diff.rb +1 -1
- data/lib/webmock/request_execution_verifier.rb +2 -3
- data/lib/webmock/request_pattern.rb +129 -51
- data/lib/webmock/request_registry.rb +1 -1
- data/lib/webmock/request_signature.rb +3 -3
- data/lib/webmock/request_signature_snippet.rb +4 -4
- data/lib/webmock/request_stub.rb +15 -0
- data/lib/webmock/response.rb +19 -13
- data/lib/webmock/rspec.rb +10 -3
- data/lib/webmock/stub_registry.rb +26 -11
- data/lib/webmock/stub_request_snippet.rb +10 -6
- data/lib/webmock/test_unit.rb +1 -3
- data/lib/webmock/util/hash_counter.rb +3 -3
- data/lib/webmock/util/headers.rb +17 -2
- data/lib/webmock/util/json.rb +1 -2
- data/lib/webmock/util/query_mapper.rb +9 -7
- data/lib/webmock/util/uri.rb +10 -10
- data/lib/webmock/util/values_stringifier.rb +20 -0
- data/lib/webmock/version.rb +1 -1
- data/lib/webmock/webmock.rb +20 -3
- data/lib/webmock.rb +53 -48
- data/minitest/webmock_spec.rb +3 -3
- data/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
- data/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
- data/spec/acceptance/curb/curb_spec.rb +44 -0
- data/spec/acceptance/em_http_request/em_http_request_spec.rb +57 -1
- data/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +2 -2
- data/spec/acceptance/excon/excon_spec.rb +4 -2
- data/spec/acceptance/excon/excon_spec_helper.rb +2 -0
- data/spec/acceptance/http_rb/http_rb_spec.rb +20 -0
- data/spec/acceptance/http_rb/http_rb_spec_helper.rb +5 -2
- data/spec/acceptance/httpclient/httpclient_spec.rb +8 -1
- data/spec/acceptance/manticore/manticore_spec.rb +51 -0
- data/spec/acceptance/net_http/net_http_shared.rb +47 -10
- data/spec/acceptance/net_http/net_http_spec.rb +102 -24
- data/spec/acceptance/net_http/real_net_http_spec.rb +1 -1
- data/spec/acceptance/patron/patron_spec.rb +26 -21
- data/spec/acceptance/patron/patron_spec_helper.rb +3 -3
- data/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +14 -14
- data/spec/acceptance/shared/callbacks.rb +3 -2
- data/spec/acceptance/shared/complex_cross_concern_behaviors.rb +1 -1
- data/spec/acceptance/shared/request_expectations.rb +14 -0
- data/spec/acceptance/shared/returning_declared_responses.rb +36 -15
- data/spec/acceptance/shared/stubbing_requests.rb +95 -0
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +1 -1
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +1 -1
- data/spec/support/webmock_server.rb +1 -0
- data/spec/unit/api_spec.rb +103 -3
- data/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
- data/spec/unit/request_execution_verifier_spec.rb +12 -12
- data/spec/unit/request_pattern_spec.rb +207 -49
- data/spec/unit/request_signature_snippet_spec.rb +2 -2
- data/spec/unit/request_signature_spec.rb +21 -1
- data/spec/unit/request_stub_spec.rb +35 -0
- data/spec/unit/response_spec.rb +51 -19
- data/spec/unit/stub_request_snippet_spec.rb +30 -10
- data/spec/unit/util/query_mapper_spec.rb +13 -0
- data/spec/unit/util/uri_spec.rb +74 -2
- data/spec/unit/webmock_spec.rb +108 -5
- data/test/shared_test.rb +15 -2
- data/test/test_webmock.rb +6 -0
- data/webmock.gemspec +15 -7
- metadata +86 -37
- data/.travis.yml +0 -20
|
@@ -70,6 +70,12 @@ describe WebMock::Util::QueryMapper do
|
|
|
70
70
|
hsh = subject.query_to_values(query)
|
|
71
71
|
expect(hsh['a']).to eq('foo')
|
|
72
72
|
end
|
|
73
|
+
|
|
74
|
+
it "should parse hash query with key starting with non word character" do
|
|
75
|
+
query = "a[$in]=1".freeze
|
|
76
|
+
hsh = subject.query_to_values(query)
|
|
77
|
+
expect(hsh).to eql({'a' => {'$in' => '1'}})
|
|
78
|
+
end
|
|
73
79
|
end
|
|
74
80
|
|
|
75
81
|
context '#to_query' do
|
|
@@ -141,4 +147,11 @@ describe WebMock::Util::QueryMapper do
|
|
|
141
147
|
expect(subject.values_to_query values).to eq query
|
|
142
148
|
expect(subject.query_to_values query).to eq values
|
|
143
149
|
end
|
|
150
|
+
|
|
151
|
+
it 'converts an empty array to ?' do
|
|
152
|
+
query = "one%5B%5D"
|
|
153
|
+
values = {"one" => []}
|
|
154
|
+
expect(subject.values_to_query values).to eq query
|
|
155
|
+
expect(subject.query_to_values query).to eq values
|
|
156
|
+
end
|
|
144
157
|
end
|
data/spec/unit/util/uri_spec.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
URIS_WITHOUT_PATH_OR_PARAMS =
|
|
5
4
|
[
|
|
6
5
|
"www.example.com",
|
|
@@ -65,7 +64,6 @@ URIS_WITH_DIFFERENT_PORT =
|
|
|
65
64
|
"http://www.example.com:88/"
|
|
66
65
|
].sort
|
|
67
66
|
|
|
68
|
-
|
|
69
67
|
URIS_FOR_HTTPS =
|
|
70
68
|
[
|
|
71
69
|
"https://www.example.com",
|
|
@@ -74,6 +72,49 @@ URIS_FOR_HTTPS =
|
|
|
74
72
|
"https://www.example.com:443/"
|
|
75
73
|
].sort
|
|
76
74
|
|
|
75
|
+
URIS_FOR_LOCALHOST =
|
|
76
|
+
[
|
|
77
|
+
"localhost",
|
|
78
|
+
"localhost/",
|
|
79
|
+
"localhost:80",
|
|
80
|
+
"localhost:80/",
|
|
81
|
+
"http://localhost",
|
|
82
|
+
"http://localhost/",
|
|
83
|
+
"http://localhost:80",
|
|
84
|
+
"http://localhost:80/"
|
|
85
|
+
].sort
|
|
86
|
+
|
|
87
|
+
URIS_WITH_SCHEME =
|
|
88
|
+
[
|
|
89
|
+
"http://www.example.com",
|
|
90
|
+
"http://www.example.com/",
|
|
91
|
+
"http://www.example.com:80",
|
|
92
|
+
"http://www.example.com:80/"
|
|
93
|
+
].sort
|
|
94
|
+
|
|
95
|
+
URIS_WITH_COLON_IN_PATH =
|
|
96
|
+
[
|
|
97
|
+
[
|
|
98
|
+
"https://example.com/a/b:80",
|
|
99
|
+
"https://example.com:443/a/b:80",
|
|
100
|
+
].sort,
|
|
101
|
+
[
|
|
102
|
+
"https://example.com:443/a/b:443",
|
|
103
|
+
"https://example.com/a/b:443",
|
|
104
|
+
].sort,
|
|
105
|
+
[
|
|
106
|
+
"http://example.com/a/b:443",
|
|
107
|
+
"example.com/a/b:443",
|
|
108
|
+
"http://example.com:80/a/b:443",
|
|
109
|
+
"example.com:80/a/b:443",
|
|
110
|
+
].sort,
|
|
111
|
+
[
|
|
112
|
+
"http://example.com/a/b:80",
|
|
113
|
+
"example.com/a/b:80",
|
|
114
|
+
"http://example.com:80/a/b:80",
|
|
115
|
+
"example.com:80/a/b:80",
|
|
116
|
+
].sort
|
|
117
|
+
]
|
|
77
118
|
|
|
78
119
|
describe WebMock::Util::URI do
|
|
79
120
|
|
|
@@ -115,6 +156,37 @@ describe WebMock::Util::URI do
|
|
|
115
156
|
end
|
|
116
157
|
end
|
|
117
158
|
|
|
159
|
+
it "should find all variations of the same uri for all variations of host names uris without a period" do
|
|
160
|
+
URIS_FOR_LOCALHOST.each do |uri|
|
|
161
|
+
expect(WebMock::Util::URI.variations_of_uri_as_strings(uri).sort).to eq(URIS_FOR_LOCALHOST)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
it "should find all variations of the same uri with scheme for all variations when only_with_scheme is true" do
|
|
166
|
+
URIS_WITHOUT_PATH_OR_PARAMS.each do |uri|
|
|
167
|
+
variations_of_uri_with_scheme = WebMock::Util::URI.variations_of_uri_as_strings(uri, only_with_scheme: true)
|
|
168
|
+
expect(variations_of_uri_with_scheme.sort).to eq(URIS_WITH_SCHEME)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it "should not replace :80 or :443 in path" do
|
|
173
|
+
URIS_WITH_COLON_IN_PATH.each do |uris|
|
|
174
|
+
uris.each do |uri|
|
|
175
|
+
expect(WebMock::Util::URI.variations_of_uri_as_strings(uri).sort).to eq(uris)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
it "should find all variations of uris with https, basic auth, a non-standard port and a path" do
|
|
181
|
+
uri = "https://~%8A:pass@www.example.com:9000/foo"
|
|
182
|
+
variations = [
|
|
183
|
+
"https://~%8A:pass@www.example.com:9000/foo",
|
|
184
|
+
"https://~\x8A:pass@www.example.com:9000/foo".force_encoding(Encoding::ASCII_8BIT)
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
expect(WebMock::Util::URI.variations_of_uri_as_strings(uri)).to eq(variations)
|
|
188
|
+
end
|
|
189
|
+
|
|
118
190
|
end
|
|
119
191
|
|
|
120
192
|
describe "normalized uri equality" do
|
data/spec/unit/webmock_spec.rb
CHANGED
|
@@ -1,11 +1,114 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "WebMock
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
describe "WebMock" do
|
|
4
|
+
|
|
5
|
+
describe ".version" do
|
|
6
|
+
it "should report version" do
|
|
7
|
+
expect(WebMock.version).to eq(WebMock::VERSION)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "should not require safe_yaml" do
|
|
11
|
+
expect(defined?SafeYAML).to eq(nil)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "should alias enable_net_connect! to allow_net_connect!" do
|
|
15
|
+
expect(WebMock.method(:enable_net_connect!)).to eq(WebMock.method(:allow_net_connect!))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should alias disallow_net_connect! to disable_net_connect!" do
|
|
19
|
+
expect(WebMock.method(:disallow_net_connect!)).to eq(WebMock.method(:disable_net_connect!))
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe ".net_connect_allowed?" do
|
|
24
|
+
context 'enabled globally' do
|
|
25
|
+
before do
|
|
26
|
+
WebMock.enable_net_connect!
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'without arguments' do
|
|
30
|
+
it 'returns WebMock::Config.instance.allow_net_connect' do
|
|
31
|
+
expect(WebMock.net_connect_allowed?).to eql(true)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
context 'disabled with allowed remote string' do
|
|
37
|
+
before do
|
|
38
|
+
WebMock.disable_net_connect!(allow: "http://192.168.64.2:20031")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
context 'without arguments' do
|
|
42
|
+
it 'returns WebMock::Config.instance.allow_net_connect' do
|
|
43
|
+
expect(WebMock.net_connect_allowed?).to eql(false)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
context 'disabled globally' do
|
|
49
|
+
before do
|
|
50
|
+
WebMock.disable_net_connect!
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
context 'without arguments' do
|
|
54
|
+
it 'returns WebMock::Config.instance.allow_net_connect' do
|
|
55
|
+
expect(WebMock.net_connect_allowed?).to eql(false)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
6
59
|
end
|
|
7
60
|
|
|
8
|
-
|
|
9
|
-
|
|
61
|
+
describe ".net_http_connect_on_start?" do
|
|
62
|
+
let(:uri) { Addressable::URI.parse("http://example.org:5432") }
|
|
63
|
+
|
|
64
|
+
it "will not connect on start when false" do
|
|
65
|
+
WebMock.disable_net_connect!
|
|
66
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(false)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it "will connect on start when true" do
|
|
70
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: true)
|
|
71
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(true)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
it "will connect on start when regexp matches" do
|
|
75
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: /example/)
|
|
76
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(true)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
it "will not connect on start when regexp does not match" do
|
|
80
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: /nope/)
|
|
81
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(false)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it "will connect on start when host matches" do
|
|
85
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "example.org")
|
|
86
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(true)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it "will not connect on start when host does not match" do
|
|
90
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "localhost")
|
|
91
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(false)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "will connect on start when host + port matches" do
|
|
95
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "example.org:5432")
|
|
96
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(true)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
it "will not connect on start when host + port does not match" do
|
|
100
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "example.org:80")
|
|
101
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(false)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it "will connect on start when scheme + host + port matches" do
|
|
105
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "http://example.org:5432")
|
|
106
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(true)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it "will not connect on start when scheme + host + port does not match" do
|
|
110
|
+
WebMock.disable_net_connect!(net_http_connect_on_start: "https://example.org:5432")
|
|
111
|
+
expect(WebMock.net_http_connect_on_start?(uri)).to be(false)
|
|
112
|
+
end
|
|
10
113
|
end
|
|
11
114
|
end
|
data/test/shared_test.rb
CHANGED
|
@@ -41,7 +41,7 @@ module SharedTest
|
|
|
41
41
|
|
|
42
42
|
def test_verification_that_expected_request_didnt_occur
|
|
43
43
|
expected_message = "The request GET http://www.example.com/ was expected to execute 1 time but it executed 0 times"
|
|
44
|
-
expected_message
|
|
44
|
+
expected_message += "\n\nThe following requests were made:\n\nNo requests were made.\n============================================================"
|
|
45
45
|
assert_fail(expected_message) do
|
|
46
46
|
assert_requested(:get, "http://www.example.com")
|
|
47
47
|
end
|
|
@@ -49,7 +49,7 @@ module SharedTest
|
|
|
49
49
|
|
|
50
50
|
def test_verification_that_expected_stub_didnt_occur
|
|
51
51
|
expected_message = "The request ANY http://www.example.com/ was expected to execute 1 time but it executed 0 times"
|
|
52
|
-
expected_message
|
|
52
|
+
expected_message += "\n\nThe following requests were made:\n\nNo requests were made.\n============================================================"
|
|
53
53
|
assert_fail(expected_message) do
|
|
54
54
|
assert_requested(@stub_http)
|
|
55
55
|
end
|
|
@@ -69,6 +69,19 @@ module SharedTest
|
|
|
69
69
|
query: hash_including({"a" => ["b", "c"]}))
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
+
def test_verification_that_expected_request_not_occured_with_query_params
|
|
73
|
+
stub_request(:any, 'http://www.example.com').with(query: hash_including(a: ['b', 'c']))
|
|
74
|
+
stub_request(:any, 'http://www.example.com').with(query: hash_excluding(a: ['b', 'c']))
|
|
75
|
+
http_request(:get, 'http://www.example.com/?a[]=b&a[]=c&x=1')
|
|
76
|
+
assert_not_requested(:get, 'http://www.example.com', query: hash_excluding('a' => ['b', 'c']))
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def test_verification_that_expected_request_occured_with_excluding_query_params
|
|
80
|
+
stub_request(:any, 'http://www.example.com').with(query: hash_excluding('a' => ['b', 'c']))
|
|
81
|
+
http_request(:get, 'http://www.example.com/?a[]=x&a[]=y&x=1')
|
|
82
|
+
assert_requested(:get, 'http://www.example.com', query: hash_excluding('a' => ['b', 'c']))
|
|
83
|
+
end
|
|
84
|
+
|
|
72
85
|
def test_verification_that_non_expected_request_didnt_occur
|
|
73
86
|
expected_message = %r(The request GET http://www.example.com/ was not expected to execute but it executed 1 time\n\nThe following requests were made:\n\nGET http://www.example.com/ with headers .+ was made 1 time\n\n============================================================)
|
|
74
87
|
assert_fail(expected_message) do
|
data/test/test_webmock.rb
CHANGED
|
@@ -3,4 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/shared_test')
|
|
|
3
3
|
|
|
4
4
|
class TestWebMock < Test::Unit::TestCase
|
|
5
5
|
include SharedTest
|
|
6
|
+
|
|
7
|
+
def teardown
|
|
8
|
+
# Ensure global Test::Unit teardown was called
|
|
9
|
+
assert_empty WebMock::RequestRegistry.instance.requested_signatures.hash
|
|
10
|
+
assert_empty WebMock::StubRegistry.instance.request_stubs
|
|
11
|
+
end
|
|
6
12
|
end
|
data/webmock.gemspec
CHANGED
|
@@ -8,23 +8,31 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
|
9
9
|
s.authors = ['Bartosz Blimke']
|
|
10
10
|
s.email = ['bartosz.blimke@gmail.com']
|
|
11
|
-
s.homepage = '
|
|
11
|
+
s.homepage = 'https://github.com/bblimke/webmock'
|
|
12
12
|
s.summary = %q{Library for stubbing HTTP requests in Ruby.}
|
|
13
13
|
s.description = %q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
|
|
14
14
|
s.license = "MIT"
|
|
15
15
|
|
|
16
|
-
s.
|
|
16
|
+
s.metadata = {
|
|
17
|
+
'bug_tracker_uri' => 'https://github.com/bblimke/webmock/issues',
|
|
18
|
+
'changelog_uri' => "https://github.com/bblimke/webmock/blob/v#{s.version}/CHANGELOG.md",
|
|
19
|
+
'documentation_uri' => "https://www.rubydoc.info/gems/webmock/#{s.version}",
|
|
20
|
+
'source_code_uri' => "https://github.com/bblimke/webmock/tree/v#{s.version}",
|
|
21
|
+
'wiki_uri' => 'https://github.com/bblimke/webmock/wiki'
|
|
22
|
+
}
|
|
17
23
|
|
|
18
|
-
s.required_ruby_version = '>= 2.
|
|
24
|
+
s.required_ruby_version = '>= 2.3'
|
|
19
25
|
|
|
20
|
-
s.add_dependency 'addressable', '>= 2.
|
|
26
|
+
s.add_dependency 'addressable', '>= 2.8.0'
|
|
21
27
|
s.add_dependency 'crack', '>= 0.3.2'
|
|
22
|
-
s.add_dependency 'hashdiff'
|
|
28
|
+
s.add_dependency 'hashdiff', ['>= 0.4.0', '< 2.0.0']
|
|
23
29
|
|
|
24
30
|
unless RUBY_PLATFORM =~ /java/
|
|
25
31
|
s.add_development_dependency 'patron', '>= 0.4.18'
|
|
26
32
|
s.add_development_dependency 'curb', '>= 0.7.16'
|
|
27
33
|
s.add_development_dependency 'typhoeus', '>= 0.5.0'
|
|
34
|
+
s.add_development_dependency 'em-http-request', '>= 1.0.2'
|
|
35
|
+
s.add_development_dependency 'em-synchrony', '>= 1.0.0'
|
|
28
36
|
end
|
|
29
37
|
|
|
30
38
|
s.add_development_dependency 'http', '>= 0.8.0'
|
|
@@ -32,12 +40,12 @@ Gem::Specification.new do |s|
|
|
|
32
40
|
s.add_development_dependency 'rack', ((RUBY_VERSION < '2.2.2') ? '1.6.0' : '> 1.6')
|
|
33
41
|
s.add_development_dependency 'rspec', '>= 3.1.0'
|
|
34
42
|
s.add_development_dependency 'httpclient', '>= 2.2.4'
|
|
35
|
-
s.add_development_dependency 'em-http-request', '>= 1.0.2'
|
|
36
|
-
s.add_development_dependency 'em-synchrony', '>= 1.0.0'
|
|
37
43
|
s.add_development_dependency 'excon', '>= 0.27.5'
|
|
44
|
+
s.add_development_dependency 'async-http', '>= 0.48.0'
|
|
38
45
|
s.add_development_dependency 'minitest', '>= 5.0.0'
|
|
39
46
|
s.add_development_dependency 'test-unit', '>= 3.0.0'
|
|
40
47
|
s.add_development_dependency 'rdoc', '> 3.5.0'
|
|
48
|
+
s.add_development_dependency 'webrick'
|
|
41
49
|
|
|
42
50
|
s.files = `git ls-files`.split("\n")
|
|
43
51
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: webmock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.18.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bartosz Blimke
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 2.
|
|
19
|
+
version: 2.8.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 2.
|
|
26
|
+
version: 2.8.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: crack
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -44,14 +44,20 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 0.4.0
|
|
48
|
+
- - "<"
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: 2.0.0
|
|
48
51
|
type: :runtime
|
|
49
52
|
prerelease: false
|
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
54
|
requirements:
|
|
52
55
|
- - ">="
|
|
53
56
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
57
|
+
version: 0.4.0
|
|
58
|
+
- - "<"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 2.0.0
|
|
55
61
|
- !ruby/object:Gem::Dependency
|
|
56
62
|
name: patron
|
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -95,89 +101,89 @@ dependencies:
|
|
|
95
101
|
- !ruby/object:Gem::Version
|
|
96
102
|
version: 0.5.0
|
|
97
103
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: http
|
|
104
|
+
name: em-http-request
|
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
|
100
106
|
requirements:
|
|
101
107
|
- - ">="
|
|
102
108
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: 0.
|
|
109
|
+
version: 1.0.2
|
|
104
110
|
type: :development
|
|
105
111
|
prerelease: false
|
|
106
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
113
|
requirements:
|
|
108
114
|
- - ">="
|
|
109
115
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: 0.
|
|
116
|
+
version: 1.0.2
|
|
111
117
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
118
|
+
name: em-synchrony
|
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
|
114
120
|
requirements:
|
|
115
|
-
- -
|
|
121
|
+
- - ">="
|
|
116
122
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 1.
|
|
123
|
+
version: 1.0.0
|
|
118
124
|
type: :development
|
|
119
125
|
prerelease: false
|
|
120
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
127
|
requirements:
|
|
122
|
-
- -
|
|
128
|
+
- - ">="
|
|
123
129
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 1.
|
|
130
|
+
version: 1.0.0
|
|
125
131
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
132
|
+
name: http
|
|
127
133
|
requirement: !ruby/object:Gem::Requirement
|
|
128
134
|
requirements:
|
|
129
135
|
- - ">="
|
|
130
136
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
137
|
+
version: 0.8.0
|
|
132
138
|
type: :development
|
|
133
139
|
prerelease: false
|
|
134
140
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
141
|
requirements:
|
|
136
142
|
- - ">="
|
|
137
143
|
- !ruby/object:Gem::Version
|
|
138
|
-
version:
|
|
144
|
+
version: 0.8.0
|
|
139
145
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
146
|
+
name: rack
|
|
141
147
|
requirement: !ruby/object:Gem::Requirement
|
|
142
148
|
requirements:
|
|
143
|
-
- - "
|
|
149
|
+
- - ">"
|
|
144
150
|
- !ruby/object:Gem::Version
|
|
145
|
-
version:
|
|
151
|
+
version: '1.6'
|
|
146
152
|
type: :development
|
|
147
153
|
prerelease: false
|
|
148
154
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
155
|
requirements:
|
|
150
|
-
- - "
|
|
156
|
+
- - ">"
|
|
151
157
|
- !ruby/object:Gem::Version
|
|
152
|
-
version:
|
|
158
|
+
version: '1.6'
|
|
153
159
|
- !ruby/object:Gem::Dependency
|
|
154
|
-
name:
|
|
160
|
+
name: rspec
|
|
155
161
|
requirement: !ruby/object:Gem::Requirement
|
|
156
162
|
requirements:
|
|
157
163
|
- - ">="
|
|
158
164
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 1.0
|
|
165
|
+
version: 3.1.0
|
|
160
166
|
type: :development
|
|
161
167
|
prerelease: false
|
|
162
168
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
169
|
requirements:
|
|
164
170
|
- - ">="
|
|
165
171
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: 1.0
|
|
172
|
+
version: 3.1.0
|
|
167
173
|
- !ruby/object:Gem::Dependency
|
|
168
|
-
name:
|
|
174
|
+
name: httpclient
|
|
169
175
|
requirement: !ruby/object:Gem::Requirement
|
|
170
176
|
requirements:
|
|
171
177
|
- - ">="
|
|
172
178
|
- !ruby/object:Gem::Version
|
|
173
|
-
version:
|
|
179
|
+
version: 2.2.4
|
|
174
180
|
type: :development
|
|
175
181
|
prerelease: false
|
|
176
182
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
183
|
requirements:
|
|
178
184
|
- - ">="
|
|
179
185
|
- !ruby/object:Gem::Version
|
|
180
|
-
version:
|
|
186
|
+
version: 2.2.4
|
|
181
187
|
- !ruby/object:Gem::Dependency
|
|
182
188
|
name: excon
|
|
183
189
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -192,6 +198,20 @@ dependencies:
|
|
|
192
198
|
- - ">="
|
|
193
199
|
- !ruby/object:Gem::Version
|
|
194
200
|
version: 0.27.5
|
|
201
|
+
- !ruby/object:Gem::Dependency
|
|
202
|
+
name: async-http
|
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
|
204
|
+
requirements:
|
|
205
|
+
- - ">="
|
|
206
|
+
- !ruby/object:Gem::Version
|
|
207
|
+
version: 0.48.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.48.0
|
|
195
215
|
- !ruby/object:Gem::Dependency
|
|
196
216
|
name: minitest
|
|
197
217
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -234,6 +254,20 @@ dependencies:
|
|
|
234
254
|
- - ">"
|
|
235
255
|
- !ruby/object:Gem::Version
|
|
236
256
|
version: 3.5.0
|
|
257
|
+
- !ruby/object:Gem::Dependency
|
|
258
|
+
name: webrick
|
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
|
260
|
+
requirements:
|
|
261
|
+
- - ">="
|
|
262
|
+
- !ruby/object:Gem::Version
|
|
263
|
+
version: '0'
|
|
264
|
+
type: :development
|
|
265
|
+
prerelease: false
|
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
267
|
+
requirements:
|
|
268
|
+
- - ">="
|
|
269
|
+
- !ruby/object:Gem::Version
|
|
270
|
+
version: '0'
|
|
237
271
|
description: WebMock allows stubbing HTTP requests and setting expectations on HTTP
|
|
238
272
|
requests.
|
|
239
273
|
email:
|
|
@@ -243,9 +277,9 @@ extensions: []
|
|
|
243
277
|
extra_rdoc_files: []
|
|
244
278
|
files:
|
|
245
279
|
- ".gemtest"
|
|
280
|
+
- ".github/workflows/CI.yml"
|
|
246
281
|
- ".gitignore"
|
|
247
282
|
- ".rspec-tm"
|
|
248
|
-
- ".travis.yml"
|
|
249
283
|
- CHANGELOG.md
|
|
250
284
|
- Gemfile
|
|
251
285
|
- LICENSE
|
|
@@ -259,6 +293,7 @@ files:
|
|
|
259
293
|
- lib/webmock/cucumber.rb
|
|
260
294
|
- lib/webmock/deprecation.rb
|
|
261
295
|
- lib/webmock/errors.rb
|
|
296
|
+
- lib/webmock/http_lib_adapters/async_http_client_adapter.rb
|
|
262
297
|
- lib/webmock/http_lib_adapters/curb_adapter.rb
|
|
263
298
|
- lib/webmock/http_lib_adapters/em_http_request_adapter.rb
|
|
264
299
|
- lib/webmock/http_lib_adapters/excon_adapter.rb
|
|
@@ -276,6 +311,9 @@ files:
|
|
|
276
311
|
- lib/webmock/http_lib_adapters/net_http_response.rb
|
|
277
312
|
- lib/webmock/http_lib_adapters/patron_adapter.rb
|
|
278
313
|
- lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
|
|
314
|
+
- lib/webmock/matchers/any_arg_matcher.rb
|
|
315
|
+
- lib/webmock/matchers/hash_argument_matcher.rb
|
|
316
|
+
- lib/webmock/matchers/hash_excluding_matcher.rb
|
|
279
317
|
- lib/webmock/matchers/hash_including_matcher.rb
|
|
280
318
|
- lib/webmock/minitest.rb
|
|
281
319
|
- lib/webmock/rack_response.rb
|
|
@@ -302,12 +340,15 @@ files:
|
|
|
302
340
|
- lib/webmock/util/json.rb
|
|
303
341
|
- lib/webmock/util/query_mapper.rb
|
|
304
342
|
- lib/webmock/util/uri.rb
|
|
343
|
+
- lib/webmock/util/values_stringifier.rb
|
|
305
344
|
- lib/webmock/util/version_checker.rb
|
|
306
345
|
- lib/webmock/version.rb
|
|
307
346
|
- lib/webmock/webmock.rb
|
|
308
347
|
- minitest/test_helper.rb
|
|
309
348
|
- minitest/test_webmock.rb
|
|
310
349
|
- minitest/webmock_spec.rb
|
|
350
|
+
- spec/acceptance/async_http_client/async_http_client_spec.rb
|
|
351
|
+
- spec/acceptance/async_http_client/async_http_client_spec_helper.rb
|
|
311
352
|
- spec/acceptance/curb/curb_spec.rb
|
|
312
353
|
- spec/acceptance/curb/curb_spec_helper.rb
|
|
313
354
|
- spec/acceptance/em_http_request/em_http_request_spec.rb
|
|
@@ -349,6 +390,7 @@ files:
|
|
|
349
390
|
- spec/unit/errors_spec.rb
|
|
350
391
|
- spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
|
|
351
392
|
- spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
|
|
393
|
+
- spec/unit/matchers/hash_excluding_matcher_spec.rb
|
|
352
394
|
- spec/unit/matchers/hash_including_matcher_spec.rb
|
|
353
395
|
- spec/unit/rack_response_spec.rb
|
|
354
396
|
- spec/unit/request_body_diff_spec.rb
|
|
@@ -374,11 +416,16 @@ files:
|
|
|
374
416
|
- test/test_helper.rb
|
|
375
417
|
- test/test_webmock.rb
|
|
376
418
|
- webmock.gemspec
|
|
377
|
-
homepage:
|
|
419
|
+
homepage: https://github.com/bblimke/webmock
|
|
378
420
|
licenses:
|
|
379
421
|
- MIT
|
|
380
|
-
metadata:
|
|
381
|
-
|
|
422
|
+
metadata:
|
|
423
|
+
bug_tracker_uri: https://github.com/bblimke/webmock/issues
|
|
424
|
+
changelog_uri: https://github.com/bblimke/webmock/blob/v3.18.1/CHANGELOG.md
|
|
425
|
+
documentation_uri: https://www.rubydoc.info/gems/webmock/3.18.1
|
|
426
|
+
source_code_uri: https://github.com/bblimke/webmock/tree/v3.18.1
|
|
427
|
+
wiki_uri: https://github.com/bblimke/webmock/wiki
|
|
428
|
+
post_install_message:
|
|
382
429
|
rdoc_options: []
|
|
383
430
|
require_paths:
|
|
384
431
|
- lib
|
|
@@ -386,19 +433,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
386
433
|
requirements:
|
|
387
434
|
- - ">="
|
|
388
435
|
- !ruby/object:Gem::Version
|
|
389
|
-
version: '2.
|
|
436
|
+
version: '2.3'
|
|
390
437
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
438
|
requirements:
|
|
392
439
|
- - ">="
|
|
393
440
|
- !ruby/object:Gem::Version
|
|
394
441
|
version: '0'
|
|
395
442
|
requirements: []
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
signing_key:
|
|
443
|
+
rubygems_version: 3.1.2
|
|
444
|
+
signing_key:
|
|
399
445
|
specification_version: 4
|
|
400
446
|
summary: Library for stubbing HTTP requests in Ruby.
|
|
401
447
|
test_files:
|
|
448
|
+
- spec/acceptance/async_http_client/async_http_client_spec.rb
|
|
449
|
+
- spec/acceptance/async_http_client/async_http_client_spec_helper.rb
|
|
402
450
|
- spec/acceptance/curb/curb_spec.rb
|
|
403
451
|
- spec/acceptance/curb/curb_spec_helper.rb
|
|
404
452
|
- spec/acceptance/em_http_request/em_http_request_spec.rb
|
|
@@ -440,6 +488,7 @@ test_files:
|
|
|
440
488
|
- spec/unit/errors_spec.rb
|
|
441
489
|
- spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
|
|
442
490
|
- spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
|
|
491
|
+
- spec/unit/matchers/hash_excluding_matcher_spec.rb
|
|
443
492
|
- spec/unit/matchers/hash_including_matcher_spec.rb
|
|
444
493
|
- spec/unit/rack_response_spec.rb
|
|
445
494
|
- spec/unit/request_body_diff_spec.rb
|
data/.travis.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
rvm:
|
|
2
|
-
- 2.0.0
|
|
3
|
-
- 2.1.0
|
|
4
|
-
- 2.2.1
|
|
5
|
-
- 2.2.3
|
|
6
|
-
- 2.3.0
|
|
7
|
-
- 2.4.0
|
|
8
|
-
- rbx-2
|
|
9
|
-
- ruby-head
|
|
10
|
-
- jruby-9.0.5.0
|
|
11
|
-
- jruby-9.1.5.0
|
|
12
|
-
- jruby-head
|
|
13
|
-
matrix:
|
|
14
|
-
allow_failures:
|
|
15
|
-
- rvm: jruby-head
|
|
16
|
-
- rvm: ruby-head
|
|
17
|
-
- rvm: rbx-2
|
|
18
|
-
# Send builds to container-based infrastructure
|
|
19
|
-
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
|
20
|
-
sudo: false
|