webmock 1.7.7 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.registered_request?(request_signature)
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.registered_request?(request_signature)
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 WebMock::StubRegistry.instance.registered_request?(request_signature)
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 WebMock::StubRegistry.instance.registered_request?(request_signature)
99
- webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
100
- on_error("WebMock timeout error") if webmock_response.should_timeout
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(webmock_response), @uri,
104
- webmock_response.should_timeout ? "WebMock timeout error" : nil)
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 WebMock::StubRegistry.instance.registered_request?(request_signature)
46
- webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
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::StubRegistry.instance.registered_request?(request_signature) ||
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.registered_request?(request_signature)
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.registered_request?(request_signature)
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.registered_request?(request_signature)
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)
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.7.7' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.7.8' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -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
@@ -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', '>= 0.7.8'
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
- version: 1.7.7
6
+ segments:
7
+ - 1
8
+ - 7
9
+ - 8
10
+ version: 1.7.8
6
11
  platform: ruby
7
12
  authors:
8
- - Bartosz Blimke
13
+ - Bartosz Blimke
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-10-15 00:00:00 +02:00
14
- default_executable:
18
+ date: 2011-11-20 00:00:00 Z
15
19
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: addressable
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ~>
23
- - !ruby/object:Gem::Version
24
- version: "2.2"
25
- - - ">"
26
- - !ruby/object:Gem::Version
27
- version: 2.2.5
28
- type: :runtime
29
- version_requirements: *id001
30
- - !ruby/object:Gem::Dependency
31
- name: crack
32
- prerelease: false
33
- requirement: &id002 !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ">="
37
- - !ruby/object:Gem::Version
38
- version: 0.1.7
39
- type: :runtime
40
- version_requirements: *id002
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- prerelease: false
44
- requirement: &id003 !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 2.0.0
50
- type: :development
51
- version_requirements: *id003
52
- - !ruby/object:Gem::Dependency
53
- name: httpclient
54
- prerelease: false
55
- requirement: &id004 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 2.1.5.2
61
- type: :development
62
- version_requirements: *id004
63
- - !ruby/object:Gem::Dependency
64
- name: patron
65
- prerelease: false
66
- requirement: &id005 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- version: 0.4.15
72
- type: :development
73
- version_requirements: *id005
74
- - !ruby/object:Gem::Dependency
75
- name: em-http-request
76
- prerelease: false
77
- requirement: &id006 !ruby/object:Gem::Requirement
78
- none: false
79
- requirements:
80
- - - ~>
81
- - !ruby/object:Gem::Version
82
- version: 0.3.0
83
- type: :development
84
- version_requirements: *id006
85
- - !ruby/object:Gem::Dependency
86
- name: curb
87
- prerelease: false
88
- requirement: &id007 !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: 0.7.8
94
- type: :development
95
- version_requirements: *id007
96
- - !ruby/object:Gem::Dependency
97
- name: typhoeus
98
- prerelease: false
99
- requirement: &id008 !ruby/object:Gem::Requirement
100
- none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: 0.2.4
105
- type: :development
106
- version_requirements: *id008
107
- - !ruby/object:Gem::Dependency
108
- name: minitest
109
- prerelease: false
110
- requirement: &id009 !ruby/object:Gem::Requirement
111
- none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- version: 2.2.2
116
- type: :development
117
- version_requirements: *id009
118
- - !ruby/object:Gem::Dependency
119
- name: rdoc
120
- prerelease: false
121
- requirement: &id010 !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ">"
125
- - !ruby/object:Gem::Version
126
- version: 3.5.0
127
- type: :development
128
- version_requirements: *id010
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
- - bartosz.blimke@gmail.com
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
- - .gemtest
140
- - .gitignore
141
- - .rspec-tm
142
- - .rvmrc
143
- - .travis.yml
144
- - CHANGELOG.md
145
- - Gemfile
146
- - Guardfile
147
- - LICENSE
148
- - README.md
149
- - Rakefile
150
- - lib/webmock.rb
151
- - lib/webmock/api.rb
152
- - lib/webmock/assertion_failure.rb
153
- - lib/webmock/callback_registry.rb
154
- - lib/webmock/config.rb
155
- - lib/webmock/cucumber.rb
156
- - lib/webmock/deprecation.rb
157
- - lib/webmock/errors.rb
158
- - lib/webmock/http_lib_adapters/curb_adapter.rb
159
- - lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb
160
- - lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb
161
- - lib/webmock/http_lib_adapters/em_http_request_adapter.rb
162
- - lib/webmock/http_lib_adapters/http_lib_adapter.rb
163
- - lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb
164
- - lib/webmock/http_lib_adapters/httpclient_adapter.rb
165
- - lib/webmock/http_lib_adapters/net_http.rb
166
- - lib/webmock/http_lib_adapters/net_http_response.rb
167
- - lib/webmock/http_lib_adapters/patron_adapter.rb
168
- - lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
169
- - lib/webmock/minitest.rb
170
- - lib/webmock/rack_response.rb
171
- - lib/webmock/request_execution_verifier.rb
172
- - lib/webmock/request_pattern.rb
173
- - lib/webmock/request_registry.rb
174
- - lib/webmock/request_signature.rb
175
- - lib/webmock/request_stub.rb
176
- - lib/webmock/response.rb
177
- - lib/webmock/responses_sequence.rb
178
- - lib/webmock/rspec.rb
179
- - lib/webmock/rspec/matchers.rb
180
- - lib/webmock/rspec/matchers/request_pattern_matcher.rb
181
- - lib/webmock/rspec/matchers/webmock_matcher.rb
182
- - lib/webmock/stub_registry.rb
183
- - lib/webmock/stub_request_snippet.rb
184
- - lib/webmock/test_unit.rb
185
- - lib/webmock/util/hash_counter.rb
186
- - lib/webmock/util/hash_keys_stringifier.rb
187
- - lib/webmock/util/headers.rb
188
- - lib/webmock/util/json.rb
189
- - lib/webmock/util/uri.rb
190
- - lib/webmock/version.rb
191
- - lib/webmock/webmock.rb
192
- - minitest/test_helper.rb
193
- - minitest/test_webmock.rb
194
- - minitest/webmock_spec.rb
195
- - spec/acceptance/curb/curb_spec.rb
196
- - spec/acceptance/curb/curb_spec_helper.rb
197
- - spec/acceptance/em_http_request/em_http_request_spec.rb
198
- - spec/acceptance/em_http_request/em_http_request_spec_helper.rb
199
- - spec/acceptance/httpclient/httpclient_spec.rb
200
- - spec/acceptance/httpclient/httpclient_spec_helper.rb
201
- - spec/acceptance/net_http/net_http_shared.rb
202
- - spec/acceptance/net_http/net_http_spec.rb
203
- - spec/acceptance/net_http/net_http_spec_helper.rb
204
- - spec/acceptance/net_http/real_net_http_spec.rb
205
- - spec/acceptance/patron/patron_spec.rb
206
- - spec/acceptance/patron/patron_spec_helper.rb
207
- - spec/acceptance/shared/allowing_and_disabling_net_connect.rb
208
- - spec/acceptance/shared/callbacks.rb
209
- - spec/acceptance/shared/enabling_and_disabling_webmock.rb
210
- - spec/acceptance/shared/precedence_of_stubs.rb
211
- - spec/acceptance/shared/request_expectations.rb
212
- - spec/acceptance/shared/returning_declared_responses.rb
213
- - spec/acceptance/shared/stubbing_requests.rb
214
- - spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
215
- - spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
216
- - spec/acceptance/webmock_shared.rb
217
- - spec/quality_spec.rb
218
- - spec/spec_helper.rb
219
- - spec/support/example_curl_output.txt
220
- - spec/support/my_rack_app.rb
221
- - spec/support/network_connection.rb
222
- - spec/support/webmock_server.rb
223
- - spec/unit/errors_spec.rb
224
- - spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
225
- - spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
226
- - spec/unit/rack_response_spec.rb
227
- - spec/unit/request_execution_verifier_spec.rb
228
- - spec/unit/request_pattern_spec.rb
229
- - spec/unit/request_registry_spec.rb
230
- - spec/unit/request_signature_spec.rb
231
- - spec/unit/request_stub_spec.rb
232
- - spec/unit/response_spec.rb
233
- - spec/unit/stub_registry_spec.rb
234
- - spec/unit/stub_request_snippet_spec.rb
235
- - spec/unit/util/hash_counter_spec.rb
236
- - spec/unit/util/hash_keys_stringifier_spec.rb
237
- - spec/unit/util/headers_spec.rb
238
- - spec/unit/util/json_spec.rb
239
- - spec/unit/util/uri_spec.rb
240
- - spec/unit/webmock_spec.rb
241
- - test/http_request.rb
242
- - test/shared_test.rb
243
- - test/test_helper.rb
244
- - test/test_webmock.rb
245
- - webmock.gemspec
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
- - lib
312
+ - lib
255
313
  required_ruby_version: !ruby/object:Gem::Requirement
256
314
  none: false
257
315
  requirements:
258
- - - ">="
259
- - !ruby/object:Gem::Version
260
- version: "0"
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
- - !ruby/object:Gem::Version
266
- version: "0"
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.5.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
- - spec/acceptance/curb/curb_spec.rb
276
- - spec/acceptance/curb/curb_spec_helper.rb
277
- - spec/acceptance/em_http_request/em_http_request_spec.rb
278
- - spec/acceptance/em_http_request/em_http_request_spec_helper.rb
279
- - spec/acceptance/httpclient/httpclient_spec.rb
280
- - spec/acceptance/httpclient/httpclient_spec_helper.rb
281
- - spec/acceptance/net_http/net_http_shared.rb
282
- - spec/acceptance/net_http/net_http_spec.rb
283
- - spec/acceptance/net_http/net_http_spec_helper.rb
284
- - spec/acceptance/net_http/real_net_http_spec.rb
285
- - spec/acceptance/patron/patron_spec.rb
286
- - spec/acceptance/patron/patron_spec_helper.rb
287
- - spec/acceptance/shared/allowing_and_disabling_net_connect.rb
288
- - spec/acceptance/shared/callbacks.rb
289
- - spec/acceptance/shared/enabling_and_disabling_webmock.rb
290
- - spec/acceptance/shared/precedence_of_stubs.rb
291
- - spec/acceptance/shared/request_expectations.rb
292
- - spec/acceptance/shared/returning_declared_responses.rb
293
- - spec/acceptance/shared/stubbing_requests.rb
294
- - spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
295
- - spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
296
- - spec/acceptance/webmock_shared.rb
297
- - spec/quality_spec.rb
298
- - spec/spec_helper.rb
299
- - spec/support/example_curl_output.txt
300
- - spec/support/my_rack_app.rb
301
- - spec/support/network_connection.rb
302
- - spec/support/webmock_server.rb
303
- - spec/unit/errors_spec.rb
304
- - spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb
305
- - spec/unit/http_lib_adapters/http_lib_adapter_spec.rb
306
- - spec/unit/rack_response_spec.rb
307
- - spec/unit/request_execution_verifier_spec.rb
308
- - spec/unit/request_pattern_spec.rb
309
- - spec/unit/request_registry_spec.rb
310
- - spec/unit/request_signature_spec.rb
311
- - spec/unit/request_stub_spec.rb
312
- - spec/unit/response_spec.rb
313
- - spec/unit/stub_registry_spec.rb
314
- - spec/unit/stub_request_snippet_spec.rb
315
- - spec/unit/util/hash_counter_spec.rb
316
- - spec/unit/util/hash_keys_stringifier_spec.rb
317
- - spec/unit/util/headers_spec.rb
318
- - spec/unit/util/json_spec.rb
319
- - spec/unit/util/uri_spec.rb
320
- - spec/unit/webmock_spec.rb
321
- - test/http_request.rb
322
- - test/shared_test.rb
323
- - test/test_helper.rb
324
- - test/test_webmock.rb
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