webmock 1.7.7 → 1.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/lib/webmock/http_lib_adapters/curb_adapter.rb +1 -2
- data/lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb +1 -2
- data/lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb +14 -7
- data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +9 -4
- data/lib/webmock/http_lib_adapters/net_http.rb +1 -2
- data/lib/webmock/http_lib_adapters/patron_adapter.rb +1 -3
- data/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +1 -3
- data/lib/webmock/stub_registry.rb +18 -1
- data/lib/webmock/version.rb +1 -1
- data/lib/webmock/webmock.rb +4 -0
- data/spec/acceptance/shared/stubbing_requests.rb +57 -0
- data/webmock.gemspec +1 -1
- metadata +348 -284
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.7.8
|
4
|
+
|
5
|
+
* Fix each adapter so that it calls a `stub.with` block only once per
|
6
|
+
request. Previously, the block would be called two or three times per
|
7
|
+
request [Myron Marston](https://github.com/myronmarston).
|
8
|
+
|
3
9
|
## 1.7.7 - RuPy 2011 release
|
4
10
|
|
5
11
|
* Passing response object to a block passed to `HTTPClient#do_get_block`. This fixes `HTTPClient.get_content` failures. [issue 130](https://github.com/bblimke/webmock/pull/130)
|
@@ -56,8 +56,7 @@ if defined?(Curl)
|
|
56
56
|
request_signature = build_request_signature
|
57
57
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
58
58
|
|
59
|
-
if WebMock::StubRegistry.instance.
|
60
|
-
webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
59
|
+
if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
61
60
|
build_curb_response(webmock_response)
|
62
61
|
WebMock::CallbackRegistry.invoke_callbacks(
|
63
62
|
{:lib => :curb}, request_signature, webmock_response)
|
@@ -52,8 +52,7 @@ if defined?(EventMachine::HttpRequest)
|
|
52
52
|
|
53
53
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
54
54
|
|
55
|
-
if WebMock::StubRegistry.instance.
|
56
|
-
webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
55
|
+
if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
57
56
|
WebMock::CallbackRegistry.invoke_callbacks(
|
58
57
|
{:lib => :em_http_request}, request_signature, webmock_response)
|
59
58
|
client = WebMockHttpClient.new(nil)
|
@@ -51,7 +51,7 @@ if defined?(EventMachine::HttpClient)
|
|
51
51
|
def webmock_activate_connection(client)
|
52
52
|
request_signature = client.request_signature
|
53
53
|
|
54
|
-
if
|
54
|
+
if client.stubbed_webmock_response
|
55
55
|
conn = HttpStubConnection.new rand(10000)
|
56
56
|
post_init
|
57
57
|
|
@@ -95,13 +95,12 @@ if defined?(EventMachine::HttpClient)
|
|
95
95
|
def send_request_with_webmock(head, body)
|
96
96
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
97
97
|
|
98
|
-
if
|
99
|
-
|
100
|
-
|
101
|
-
WebMock::CallbackRegistry.invoke_callbacks({:lib => :em_http_request}, request_signature, webmock_response)
|
98
|
+
if stubbed_webmock_response
|
99
|
+
on_error("WebMock timeout error") if stubbed_webmock_response.should_timeout
|
100
|
+
WebMock::CallbackRegistry.invoke_callbacks({:lib => :em_http_request}, request_signature, stubbed_webmock_response)
|
102
101
|
EM.next_tick {
|
103
|
-
setup(make_raw_response(
|
104
|
-
|
102
|
+
setup(make_raw_response(stubbed_webmock_response), @uri,
|
103
|
+
stubbed_webmock_response.should_timeout ? "WebMock timeout error" : nil)
|
105
104
|
}
|
106
105
|
self
|
107
106
|
elsif WebMock.net_connect_allowed?(request_signature.uri)
|
@@ -128,6 +127,14 @@ if defined?(EventMachine::HttpClient)
|
|
128
127
|
@request_signature ||= build_request_signature
|
129
128
|
end
|
130
129
|
|
130
|
+
def stubbed_webmock_response
|
131
|
+
unless defined?(@stubbed_webmock_response)
|
132
|
+
@stubbed_webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
133
|
+
end
|
134
|
+
|
135
|
+
@stubbed_webmock_response
|
136
|
+
end
|
137
|
+
|
131
138
|
private
|
132
139
|
|
133
140
|
def build_webmock_response
|
@@ -42,8 +42,8 @@ if defined?(::HTTPClient)
|
|
42
42
|
|
43
43
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
44
44
|
|
45
|
-
if
|
46
|
-
webmock_response =
|
45
|
+
if webmock_responses[request_signature]
|
46
|
+
webmock_response = webmock_responses.delete(request_signature)
|
47
47
|
response = build_httpclient_response(webmock_response, stream, &block)
|
48
48
|
@request_filter.each do |filter|
|
49
49
|
filter.filter_response(req, response)
|
@@ -76,8 +76,7 @@ if defined?(::HTTPClient)
|
|
76
76
|
req = create_request(method, uri, query, body, extheader)
|
77
77
|
request_signature = build_request_signature(req)
|
78
78
|
|
79
|
-
if WebMock
|
80
|
-
WebMock.net_connect_allowed?(request_signature.uri)
|
79
|
+
if webmock_responses[request_signature] || WebMock.net_connect_allowed?(request_signature.uri)
|
81
80
|
do_request_async_without_webmock(method, uri, query, body, extheader)
|
82
81
|
else
|
83
82
|
raise WebMock::NetConnectNotAllowedError.new(request_signature)
|
@@ -158,4 +157,10 @@ if defined?(::HTTPClient)
|
|
158
157
|
)
|
159
158
|
end
|
160
159
|
|
160
|
+
def webmock_responses
|
161
|
+
@webmock_responses ||= Hash.new do |hash, request_signature|
|
162
|
+
hash[request_signature] = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
161
166
|
end
|
@@ -68,9 +68,8 @@ module WebMock
|
|
68
68
|
|
69
69
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
70
70
|
|
71
|
-
if WebMock::StubRegistry.instance.
|
71
|
+
if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
72
72
|
@socket = Net::HTTP.socket_type.new
|
73
|
-
webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
74
73
|
WebMock::CallbackRegistry.invoke_callbacks(
|
75
74
|
{:lib => :net_http}, request_signature, webmock_response)
|
76
75
|
build_net_http_response(webmock_response, &block)
|
@@ -19,9 +19,7 @@ if defined?(::Patron)
|
|
19
19
|
|
20
20
|
WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
21
21
|
|
22
|
-
if WebMock::StubRegistry.instance.
|
23
|
-
webmock_response =
|
24
|
-
WebMock::StubRegistry.instance.response_for_request(request_signature)
|
22
|
+
if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
|
25
23
|
WebMock::HttpLibAdapters::PatronAdapter.
|
26
24
|
handle_file_name(req, webmock_response)
|
27
25
|
res = WebMock::HttpLibAdapters::PatronAdapter.
|
@@ -140,9 +140,7 @@ if defined?(Typhoeus)
|
|
140
140
|
|
141
141
|
::WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
|
142
142
|
|
143
|
-
if ::WebMock::StubRegistry.instance.
|
144
|
-
webmock_response =
|
145
|
-
::WebMock::StubRegistry.instance.response_for_request(request_signature)
|
143
|
+
if webmock_response = ::WebMock::StubRegistry.instance.response_for_request(request_signature)
|
146
144
|
::WebMock::HttpLibAdapters::TyphoeusAdapter.
|
147
145
|
stub_typhoeus(request_signature, webmock_response, self)
|
148
146
|
webmock_response.raise_error_if_any
|
@@ -4,13 +4,30 @@ module WebMock
|
|
4
4
|
include Singleton
|
5
5
|
|
6
6
|
attr_accessor :request_stubs
|
7
|
+
attr_accessor :global_stub
|
7
8
|
|
8
9
|
def initialize
|
9
10
|
reset!
|
10
11
|
end
|
11
12
|
|
12
13
|
def reset!
|
13
|
-
self.request_stubs = []
|
14
|
+
self.request_stubs = global_stub ? [global_stub] : []
|
15
|
+
end
|
16
|
+
|
17
|
+
def global_stub_block=(block)
|
18
|
+
self.global_stub = ::WebMock::RequestStub.new(:any, /.*/)
|
19
|
+
|
20
|
+
# This hash contains the responses returned by the block,
|
21
|
+
# keyed by the exact request (using the object_id).
|
22
|
+
# That way, there's no race condition in case #to_return
|
23
|
+
# doesn't run immediately after stub.with.
|
24
|
+
responses = {}
|
25
|
+
|
26
|
+
self.global_stub.with { |request|
|
27
|
+
responses[request.object_id] = block.call(request)
|
28
|
+
}.to_return(lambda { |request| responses.delete(request.object_id) })
|
29
|
+
|
30
|
+
register_request_stub(self.global_stub)
|
14
31
|
end
|
15
32
|
|
16
33
|
def register_request_stub(stub)
|
data/lib/webmock/version.rb
CHANGED
data/lib/webmock/webmock.rb
CHANGED
@@ -88,6 +88,10 @@ module WebMock
|
|
88
88
|
puts WebMock::RequestExecutionVerifier.executed_requests_message
|
89
89
|
end
|
90
90
|
|
91
|
+
def self.globally_stub_request(&block)
|
92
|
+
WebMock::StubRegistry.instance.global_stub_block = block
|
93
|
+
end
|
94
|
+
|
91
95
|
%w(
|
92
96
|
allow_net_connect!
|
93
97
|
disable_net_connect!
|
@@ -287,6 +287,56 @@ shared_examples_for "stubbing requests" do
|
|
287
287
|
end
|
288
288
|
end
|
289
289
|
|
290
|
+
describe "when stubbing request with a global hook" do
|
291
|
+
after(:each) do
|
292
|
+
WebMock::StubRegistry.instance.global_stub = nil
|
293
|
+
end
|
294
|
+
|
295
|
+
it 'returns the response returned by the hook' do
|
296
|
+
WebMock.globally_stub_request do |request|
|
297
|
+
{ :body => "global stub body" }
|
298
|
+
end
|
299
|
+
|
300
|
+
http_request(:get, "http://www.example.com/").body.should == "global stub body"
|
301
|
+
end
|
302
|
+
|
303
|
+
it 'does not get cleared when a user calls WebMock.reset!' do
|
304
|
+
WebMock.globally_stub_request do |request|
|
305
|
+
{ :body => "global stub body" }
|
306
|
+
end
|
307
|
+
WebMock.reset!
|
308
|
+
http_request(:get, "http://www.example.com/").body.should == "global stub body"
|
309
|
+
end
|
310
|
+
|
311
|
+
it "does not stub the request if the hook does not return anything" do
|
312
|
+
WebMock.globally_stub_request { |r| }
|
313
|
+
lambda {
|
314
|
+
http_request(:get, "http://www.example.com/")
|
315
|
+
}.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: GET http://www.example.com/))
|
316
|
+
end
|
317
|
+
|
318
|
+
it "passes the request to the block" do
|
319
|
+
passed_request = nil
|
320
|
+
WebMock.globally_stub_request do |request|
|
321
|
+
passed_request = request
|
322
|
+
{ :body => "global stub body" }
|
323
|
+
end
|
324
|
+
|
325
|
+
http_request(:get, "http://www.example.com:456/bar")
|
326
|
+
passed_request.uri.to_s.should == "http://www.example.com:456/bar"
|
327
|
+
end
|
328
|
+
|
329
|
+
it "should call the block only once per request" do
|
330
|
+
call_count = 0
|
331
|
+
WebMock.globally_stub_request do |request|
|
332
|
+
call_count += 1
|
333
|
+
{ :body => "global stub body" }
|
334
|
+
end
|
335
|
+
http_request(:get, "http://www.example.com/")
|
336
|
+
call_count.should == 1
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
290
340
|
describe "when stubbing request with a block evaluated on request" do
|
291
341
|
it "should match if block returns true" do
|
292
342
|
stub_request(:get, "www.example.com").with { |request| true }
|
@@ -309,6 +359,13 @@ shared_examples_for "stubbing requests" do
|
|
309
359
|
http_request(:post, "http://www.example.com/", :body => "jander")
|
310
360
|
}.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: POST http://www.example.com/ with body 'jander'))
|
311
361
|
end
|
362
|
+
|
363
|
+
it "should call the block only once per request" do
|
364
|
+
call_count = 0
|
365
|
+
stub_request(:get, "www.example.com").with { |request| call_count += 1; true }
|
366
|
+
http_request(:get, "http://www.example.com/").status.should == "200"
|
367
|
+
call_count.should == 1
|
368
|
+
end
|
312
369
|
end
|
313
370
|
end
|
314
371
|
end
|
data/webmock.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_development_dependency 'httpclient', '>= 2.1.5.2'
|
22
22
|
s.add_development_dependency 'patron', '>= 0.4.15'
|
23
23
|
s.add_development_dependency 'em-http-request', '~> 0.3.0'
|
24
|
-
s.add_development_dependency 'curb', '
|
24
|
+
s.add_development_dependency 'curb', '0.7.15'
|
25
25
|
s.add_development_dependency 'typhoeus', '>= 0.2.4'
|
26
26
|
s.add_development_dependency 'minitest', '>= 2.2.2'
|
27
27
|
s.add_development_dependency 'rdoc', ((RUBY_VERSION == '1.8.6') ? '<= 3.5.0' : '>3.5.0')
|
metadata
CHANGED
@@ -1,134 +1,193 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 7
|
9
|
+
- 8
|
10
|
+
version: 1.7.8
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
|
-
|
13
|
+
- Bartosz Blimke
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
18
|
+
date: 2011-11-20 00:00:00 Z
|
15
19
|
dependencies:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
name: addressable
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 2
|
33
|
+
version: "2.2"
|
34
|
+
- - ">"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
hash: 13
|
37
|
+
segments:
|
38
|
+
- 2
|
39
|
+
- 2
|
40
|
+
- 5
|
41
|
+
version: 2.2.5
|
42
|
+
requirement: *id001
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
name: crack
|
47
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
hash: 21
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
- 1
|
56
|
+
- 7
|
57
|
+
version: 0.1.7
|
58
|
+
requirement: *id002
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
name: rspec
|
63
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 15
|
69
|
+
segments:
|
70
|
+
- 2
|
71
|
+
- 0
|
72
|
+
- 0
|
73
|
+
version: 2.0.0
|
74
|
+
requirement: *id003
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
name: httpclient
|
79
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 119
|
85
|
+
segments:
|
86
|
+
- 2
|
87
|
+
- 1
|
88
|
+
- 5
|
89
|
+
- 2
|
90
|
+
version: 2.1.5.2
|
91
|
+
requirement: *id004
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
name: patron
|
96
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 17
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
- 4
|
105
|
+
- 15
|
106
|
+
version: 0.4.15
|
107
|
+
requirement: *id005
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
type: :development
|
110
|
+
prerelease: false
|
111
|
+
name: em-http-request
|
112
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 19
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
- 3
|
121
|
+
- 0
|
122
|
+
version: 0.3.0
|
123
|
+
requirement: *id006
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
name: curb
|
128
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - "="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 29
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
- 7
|
137
|
+
- 15
|
138
|
+
version: 0.7.15
|
139
|
+
requirement: *id007
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
type: :development
|
142
|
+
prerelease: false
|
143
|
+
name: typhoeus
|
144
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
hash: 31
|
150
|
+
segments:
|
151
|
+
- 0
|
152
|
+
- 2
|
153
|
+
- 4
|
154
|
+
version: 0.2.4
|
155
|
+
requirement: *id008
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
type: :development
|
158
|
+
prerelease: false
|
159
|
+
name: minitest
|
160
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
hash: 3
|
166
|
+
segments:
|
167
|
+
- 2
|
168
|
+
- 2
|
169
|
+
- 2
|
170
|
+
version: 2.2.2
|
171
|
+
requirement: *id009
|
172
|
+
- !ruby/object:Gem::Dependency
|
173
|
+
type: :development
|
174
|
+
prerelease: false
|
175
|
+
name: rdoc
|
176
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ">"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
hash: 19
|
182
|
+
segments:
|
183
|
+
- 3
|
184
|
+
- 5
|
185
|
+
- 0
|
186
|
+
version: 3.5.0
|
187
|
+
requirement: *id010
|
129
188
|
description: WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.
|
130
189
|
email:
|
131
|
-
|
190
|
+
- bartosz.blimke@gmail.com
|
132
191
|
executables: []
|
133
192
|
|
134
193
|
extensions: []
|
@@ -136,114 +195,113 @@ extensions: []
|
|
136
195
|
extra_rdoc_files: []
|
137
196
|
|
138
197
|
files:
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
has_rdoc: true
|
198
|
+
- .gemtest
|
199
|
+
- .gitignore
|
200
|
+
- .rspec-tm
|
201
|
+
- .rvmrc
|
202
|
+
- .travis.yml
|
203
|
+
- CHANGELOG.md
|
204
|
+
- Gemfile
|
205
|
+
- Guardfile
|
206
|
+
- LICENSE
|
207
|
+
- README.md
|
208
|
+
- Rakefile
|
209
|
+
- lib/webmock.rb
|
210
|
+
- lib/webmock/api.rb
|
211
|
+
- lib/webmock/assertion_failure.rb
|
212
|
+
- lib/webmock/callback_registry.rb
|
213
|
+
- lib/webmock/config.rb
|
214
|
+
- lib/webmock/cucumber.rb
|
215
|
+
- lib/webmock/deprecation.rb
|
216
|
+
- lib/webmock/errors.rb
|
217
|
+
- lib/webmock/http_lib_adapters/curb_adapter.rb
|
218
|
+
- lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb
|
219
|
+
- lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb
|
220
|
+
- lib/webmock/http_lib_adapters/em_http_request_adapter.rb
|
221
|
+
- lib/webmock/http_lib_adapters/http_lib_adapter.rb
|
222
|
+
- lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb
|
223
|
+
- lib/webmock/http_lib_adapters/httpclient_adapter.rb
|
224
|
+
- lib/webmock/http_lib_adapters/net_http.rb
|
225
|
+
- lib/webmock/http_lib_adapters/net_http_response.rb
|
226
|
+
- lib/webmock/http_lib_adapters/patron_adapter.rb
|
227
|
+
- lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
|
228
|
+
- lib/webmock/minitest.rb
|
229
|
+
- lib/webmock/rack_response.rb
|
230
|
+
- lib/webmock/request_execution_verifier.rb
|
231
|
+
- lib/webmock/request_pattern.rb
|
232
|
+
- lib/webmock/request_registry.rb
|
233
|
+
- lib/webmock/request_signature.rb
|
234
|
+
- lib/webmock/request_stub.rb
|
235
|
+
- lib/webmock/response.rb
|
236
|
+
- lib/webmock/responses_sequence.rb
|
237
|
+
- lib/webmock/rspec.rb
|
238
|
+
- lib/webmock/rspec/matchers.rb
|
239
|
+
- lib/webmock/rspec/matchers/request_pattern_matcher.rb
|
240
|
+
- lib/webmock/rspec/matchers/webmock_matcher.rb
|
241
|
+
- lib/webmock/stub_registry.rb
|
242
|
+
- lib/webmock/stub_request_snippet.rb
|
243
|
+
- lib/webmock/test_unit.rb
|
244
|
+
- lib/webmock/util/hash_counter.rb
|
245
|
+
- lib/webmock/util/hash_keys_stringifier.rb
|
246
|
+
- lib/webmock/util/headers.rb
|
247
|
+
- lib/webmock/util/json.rb
|
248
|
+
- lib/webmock/util/uri.rb
|
249
|
+
- lib/webmock/version.rb
|
250
|
+
- lib/webmock/webmock.rb
|
251
|
+
- minitest/test_helper.rb
|
252
|
+
- minitest/test_webmock.rb
|
253
|
+
- minitest/webmock_spec.rb
|
254
|
+
- spec/acceptance/curb/curb_spec.rb
|
255
|
+
- spec/acceptance/curb/curb_spec_helper.rb
|
256
|
+
- spec/acceptance/em_http_request/em_http_request_spec.rb
|
257
|
+
- spec/acceptance/em_http_request/em_http_request_spec_helper.rb
|
258
|
+
- spec/acceptance/httpclient/httpclient_spec.rb
|
259
|
+
- spec/acceptance/httpclient/httpclient_spec_helper.rb
|
260
|
+
- spec/acceptance/net_http/net_http_shared.rb
|
261
|
+
- spec/acceptance/net_http/net_http_spec.rb
|
262
|
+
- spec/acceptance/net_http/net_http_spec_helper.rb
|
263
|
+
- spec/acceptance/net_http/real_net_http_spec.rb
|
264
|
+
- spec/acceptance/patron/patron_spec.rb
|
265
|
+
- spec/acceptance/patron/patron_spec_helper.rb
|
266
|
+
- spec/acceptance/shared/allowing_and_disabling_net_connect.rb
|
267
|
+
- spec/acceptance/shared/callbacks.rb
|
268
|
+
- spec/acceptance/shared/enabling_and_disabling_webmock.rb
|
269
|
+
- spec/acceptance/shared/precedence_of_stubs.rb
|
270
|
+
- spec/acceptance/shared/request_expectations.rb
|
271
|
+
- spec/acceptance/shared/returning_declared_responses.rb
|
272
|
+
- spec/acceptance/shared/stubbing_requests.rb
|
273
|
+
- spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
|
274
|
+
- spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
|
275
|
+
- spec/acceptance/webmock_shared.rb
|
276
|
+
- spec/quality_spec.rb
|
277
|
+
- spec/spec_helper.rb
|
278
|
+
- spec/support/example_curl_output.txt
|
279
|
+
- spec/support/my_rack_app.rb
|
280
|
+
- spec/support/network_connection.rb
|
281
|
+
- spec/support/webmock_server.rb
|
282
|
+
- spec/unit/errors_spec.rb
|
283
|
+
- spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
|
284
|
+
- spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
|
285
|
+
- spec/unit/rack_response_spec.rb
|
286
|
+
- spec/unit/request_execution_verifier_spec.rb
|
287
|
+
- spec/unit/request_pattern_spec.rb
|
288
|
+
- spec/unit/request_registry_spec.rb
|
289
|
+
- spec/unit/request_signature_spec.rb
|
290
|
+
- spec/unit/request_stub_spec.rb
|
291
|
+
- spec/unit/response_spec.rb
|
292
|
+
- spec/unit/stub_registry_spec.rb
|
293
|
+
- spec/unit/stub_request_snippet_spec.rb
|
294
|
+
- spec/unit/util/hash_counter_spec.rb
|
295
|
+
- spec/unit/util/hash_keys_stringifier_spec.rb
|
296
|
+
- spec/unit/util/headers_spec.rb
|
297
|
+
- spec/unit/util/json_spec.rb
|
298
|
+
- spec/unit/util/uri_spec.rb
|
299
|
+
- spec/unit/webmock_spec.rb
|
300
|
+
- test/http_request.rb
|
301
|
+
- test/shared_test.rb
|
302
|
+
- test/test_helper.rb
|
303
|
+
- test/test_webmock.rb
|
304
|
+
- webmock.gemspec
|
247
305
|
homepage: http://github.com/bblimke/webmock
|
248
306
|
licenses: []
|
249
307
|
|
@@ -251,74 +309,80 @@ post_install_message:
|
|
251
309
|
rdoc_options: []
|
252
310
|
|
253
311
|
require_paths:
|
254
|
-
|
312
|
+
- lib
|
255
313
|
required_ruby_version: !ruby/object:Gem::Requirement
|
256
314
|
none: false
|
257
315
|
requirements:
|
258
|
-
|
259
|
-
|
260
|
-
|
316
|
+
- - ">="
|
317
|
+
- !ruby/object:Gem::Version
|
318
|
+
hash: 3
|
319
|
+
segments:
|
320
|
+
- 0
|
321
|
+
version: "0"
|
261
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
323
|
none: false
|
263
324
|
requirements:
|
264
|
-
|
265
|
-
|
266
|
-
|
325
|
+
- - ">="
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
hash: 3
|
328
|
+
segments:
|
329
|
+
- 0
|
330
|
+
version: "0"
|
267
331
|
requirements: []
|
268
332
|
|
269
333
|
rubyforge_project: webmock
|
270
|
-
rubygems_version: 1.
|
334
|
+
rubygems_version: 1.8.6
|
271
335
|
signing_key:
|
272
336
|
specification_version: 3
|
273
337
|
summary: Library for stubbing HTTP requests in Ruby.
|
274
338
|
test_files:
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
339
|
+
- spec/acceptance/curb/curb_spec.rb
|
340
|
+
- spec/acceptance/curb/curb_spec_helper.rb
|
341
|
+
- spec/acceptance/em_http_request/em_http_request_spec.rb
|
342
|
+
- spec/acceptance/em_http_request/em_http_request_spec_helper.rb
|
343
|
+
- spec/acceptance/httpclient/httpclient_spec.rb
|
344
|
+
- spec/acceptance/httpclient/httpclient_spec_helper.rb
|
345
|
+
- spec/acceptance/net_http/net_http_shared.rb
|
346
|
+
- spec/acceptance/net_http/net_http_spec.rb
|
347
|
+
- spec/acceptance/net_http/net_http_spec_helper.rb
|
348
|
+
- spec/acceptance/net_http/real_net_http_spec.rb
|
349
|
+
- spec/acceptance/patron/patron_spec.rb
|
350
|
+
- spec/acceptance/patron/patron_spec_helper.rb
|
351
|
+
- spec/acceptance/shared/allowing_and_disabling_net_connect.rb
|
352
|
+
- spec/acceptance/shared/callbacks.rb
|
353
|
+
- spec/acceptance/shared/enabling_and_disabling_webmock.rb
|
354
|
+
- spec/acceptance/shared/precedence_of_stubs.rb
|
355
|
+
- spec/acceptance/shared/request_expectations.rb
|
356
|
+
- spec/acceptance/shared/returning_declared_responses.rb
|
357
|
+
- spec/acceptance/shared/stubbing_requests.rb
|
358
|
+
- spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
|
359
|
+
- spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
|
360
|
+
- spec/acceptance/webmock_shared.rb
|
361
|
+
- spec/quality_spec.rb
|
362
|
+
- spec/spec_helper.rb
|
363
|
+
- spec/support/example_curl_output.txt
|
364
|
+
- spec/support/my_rack_app.rb
|
365
|
+
- spec/support/network_connection.rb
|
366
|
+
- spec/support/webmock_server.rb
|
367
|
+
- spec/unit/errors_spec.rb
|
368
|
+
- spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
|
369
|
+
- spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
|
370
|
+
- spec/unit/rack_response_spec.rb
|
371
|
+
- spec/unit/request_execution_verifier_spec.rb
|
372
|
+
- spec/unit/request_pattern_spec.rb
|
373
|
+
- spec/unit/request_registry_spec.rb
|
374
|
+
- spec/unit/request_signature_spec.rb
|
375
|
+
- spec/unit/request_stub_spec.rb
|
376
|
+
- spec/unit/response_spec.rb
|
377
|
+
- spec/unit/stub_registry_spec.rb
|
378
|
+
- spec/unit/stub_request_snippet_spec.rb
|
379
|
+
- spec/unit/util/hash_counter_spec.rb
|
380
|
+
- spec/unit/util/hash_keys_stringifier_spec.rb
|
381
|
+
- spec/unit/util/headers_spec.rb
|
382
|
+
- spec/unit/util/json_spec.rb
|
383
|
+
- spec/unit/util/uri_spec.rb
|
384
|
+
- spec/unit/webmock_spec.rb
|
385
|
+
- test/http_request.rb
|
386
|
+
- test/shared_test.rb
|
387
|
+
- test/test_helper.rb
|
388
|
+
- test/test_webmock.rb
|