Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 729 lines (478 sloc) 23.74 kb
ea67054 @ryansch Fixing travis-ci image to report master's status
ryansch authored
1 WebMock [![Build Status](https://secure.travis-ci.org/bblimke/webmock.png?branch=master)](http://travis-ci.org/bblimke/webmock) [![Dependency Status](https://gemnasium.com/bblimke/webmock.png)](http://gemnasium.com/bblimke/webmock)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
2 =======
3
0016b13 Minor changes to README
Bartosz Blimke authored
4 Library for stubbing and setting expectations on HTTP requests in Ruby.
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
5
6 Features
7 --------
8
0016b13 Minor changes to README
Bartosz Blimke authored
9 * Stubbing HTTP requests at low http client lib level (no need to change tests when you change HTTP library)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
10 * Setting and verifying expectations on HTTP requests
11 * Matching requests based on method, URI, headers and body
12 * Smart matching of the same URIs in different representations (also encoded and non encoded forms)
13 * Smart matching of the same headers in different representations.
9c8c463 Updated README with information about RSpec 2 support.
Bartosz Blimke authored
14 * Support for Test::Unit
15 * Support for RSpec 1.x and RSpec 2.x
5627070 @bblimke Updated README with info about MiniTest support.
authored
16 * Support for MiniTest
fb18a01 Updated README with info about matching request body against hash
Bartosz Blimke authored
17
18 Supported HTTP libraries
19 ------------------------
20
3d84ef6 Added EM-HTTP-Request to the list of supported http clients
Bartosz Blimke authored
21 * Net::HTTP and libraries based on Net::HTTP (i.e RightHttpConnection, REST Client, HTTParty)
fb18a01 Updated README with info about matching request body against hash
Bartosz Blimke authored
22 * HTTPClient
23 * Patron
3d84ef6 Added EM-HTTP-Request to the list of supported http clients
Bartosz Blimke authored
24 * EM-HTTP-Request
ed9ff32 @bblimke WebMock currently doesn't support Curb::Multi
authored
25 * Curb (currently only Curb::Easy)
21aba84 @bblimke Updated README and Changelog with inf about Typhoeus support
authored
26 * Typhoeus (currently only Typhoeus::Hydra)
68ba906 @bblimke Updated Changelog and Readme with the latest changes in master
authored
27 * Excon
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
28
34c758e @bblimke Listed supported Ruby interpreters in README
authored
29 Supported Ruby Interpreters
30 ---------------------------
31
32 * MRI 1.8.6
33 * MRI 1.8.7
34 * MRI 1.9.1
35 * MRI 1.9.2
68ba906 @bblimke Updated Changelog and Readme with the latest changes in master
authored
36 * MRI 1.9.3
34c758e @bblimke Listed supported Ruby interpreters in README
authored
37 * REE 1.8.7
38 * JRuby
8955914 @bblimke Added Rubinius to a list of Ruby interpreters compatible with WebMock
authored
39 * Rubinius
163f678 @bblimke Fixed README formatting
authored
40
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
41 ##Installation
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
42
51665d3 @rohit gemcutter is now rubygems so no need to specify source
rohit authored
43 gem install webmock
7a8bab1 @bblimke Added info on how to install the latest development version of WebMock f...
authored
44
45 ### or to install the latest development version from github master
46
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
47 git clone http://github.com/bblimke/webmock.git
48 cd webmock
49 rake install
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
50
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
51 ### Test::Unit
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
52
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
53 Add the following code to `test/test_helper.rb`
54
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
55 require 'webmock/test_unit'
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
56
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
57 ### RSpec
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
58
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
59 Add the following code to `spec/spec_helper`:
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
60
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
61 require 'webmock/rspec'
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
62
bd43897 @bblimke Added info about minitest support to README
authored
63 ### MiniTest
64
65 Add the following code to `test/test_helper`:
66
67 require 'webmock/minitest'
68
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
69 ### Cucumber
70
71 Add the following code to `features/support/env.rb`
3ca443e WebMock module has to be included manually and is not included by RSpec ...
Bartosz Blimke authored
72
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
73 require 'webmock/cucumber'
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
74
032a567 @jordelver Make README a bit clearer
jordelver authored
75 ### Outside a test framework
76
f25a213 @bblimke Improved README on how to include WebMock in Test::Unit, RSpec and Cucum...
authored
77 You can also use WebMock outside a test framework:
78
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
79 require 'webmock'
80 include WebMock::API
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
81
82 ## Examples
83
84
85
86 ## Stubbing
87
88
89 ### Stubbed request based on uri only and with the default response
90
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
91 stub_request(:any, "www.example.com")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
92
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
93 Net::HTTP.get("www.example.com", "/") # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
94
95 ### Stubbing requests based on method, uri, body and headers
96
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
97 stub_request(:post, "www.example.com").with(:body => "abc", :headers => { 'Content-Length' => 3 })
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
98
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
99 uri = URI.parse("http://www.example.com/")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
100 req = Net::HTTP::Post.new(uri.path)
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
101 req['Content-Length'] = 3
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
102 res = Net::HTTP.start(uri.host, uri.port) {|http|
103 http.request(req, "abc")
104 } # ===> Success
105
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
106 ### Matching request body and headers against regular expressions
107
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
108 stub_request(:post, "www.example.com").
109 with(:body => /^.*world$/, :headers => {"Content-Type" => /image\/.+/}).to_return(:body => "abc")
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
110
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
111 uri = URI.parse('http://www.example.com/')
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
112 req = Net::HTTP::Post.new(uri.path)
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
113 req['Content-Type'] = 'image/png'
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
114 res = Net::HTTP.start(uri.host, uri.port) {|http|
115 http.request(req, 'hello world')
116 } # ===> Success
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
117
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
118 ### Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
fb18a01 Updated README with info about matching request body against hash
Bartosz Blimke authored
119
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
120 stub_http_request(:post, "www.example.com").
121 with(:body => {:data => {:a => '1', :b => 'five'}})
122
123 RestClient.post('www.example.com', "data[a]=1&data[b]=five",
124 :content_type => 'application/x-www-form-urlencoded') # ===> Success
fb18a01 Updated README with info about matching request body against hash
Bartosz Blimke authored
125
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
126 RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
127 :content_type => 'application/json') # ===> Success
128
129 RestClient.post('www.example.com', '<data a="1" b="five" />',
130 :content_type => 'application/xml' ) # ===> Success
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
131
336b143 @bblimke Matching request body against partial hash with hash_including matcher.
authored
132 ### Matching request body against partial hash.
133
134 stub_http_request(:post, "www.example.com").
135 with(:body => hash_including({:data => {:a => '1', :b => 'five'}}))
136
137 RestClient.post('www.example.com', "data[a]=1&data[b]=five&x=1",
138 :content_type => 'application/x-www-form-urlencoded') # ===> Success
139
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
140 ### Matching custom request headers
141
0016b13 Minor changes to README
Bartosz Blimke authored
142 stub_request(:any, "www.example.com").with(:headers=>{ 'Header-Name' => 'Header-Value' })
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
143
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
144 uri = URI.parse('http://www.example.com/')
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
145 req = Net::HTTP::Post.new(uri.path)
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
146 req['Header-Name'] = 'Header-Value'
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
147 res = Net::HTTP.start(uri.host, uri.port) {|http|
148 http.request(req, 'abc')
149 } # ===> Success
150
176482c Updated README with 1.1.0 changes
Bartosz Blimke authored
151 ### Matching multiple headers with the same name
152
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
153 stub_http_request(:get, 'www.example.com').with(:headers => {'Accept' => ['image/jpeg', 'image/png'] })
154
155 req = Net::HTTP::Get.new("/")
156 req['Accept'] = ['image/png']
157 req.add_field('Accept', 'image/jpeg')
158 Net::HTTP.start("www.example.com") {|http| http.request(req) } # ===> Success
176482c Updated README with 1.1.0 changes
Bartosz Blimke authored
159
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
160 ### Matching requests against provided block
161
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
162 stub_request(:post, "www.example.com").with { |request| request.body == "abc" }
163 RestClient.post('www.example.com', 'abc') # ===> Success
164
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
165 ### Request with basic authentication
166
167 stub_request(:get, "user:pass@www.example.com")
168
169 Net::HTTP.start('www.example.com') {|http|
170 req = Net::HTTP::Get.new('/')
171 req.basic_auth 'user', 'pass'
172 http.request(req)
173 } # ===> Success
174
175 ### Matching uris using regular expressions
176
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
177 stub_request(:any, /.*example.*/)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
178
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
179 Net::HTTP.get('www.example.com', '/') # ===> Success
180
181 ### Matching query params using hash
182
183 stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
184
185 RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
186
2d03aca @bblimke Added support for matching partial query params with "hash_including"
authored
187 ### Matching partial query params using hash
188
189 stub_http_request(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
190
191 RestClient.get("http://www.example.com/?a[]=b&a[]=c&x=1") # ===> Success
192
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
193 ### Stubbing with custom response
194
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
195 stub_request(:any, "www.example.com").to_return(:body => "abc", :status => 200, :headers => { 'Content-Length' => 3 } )
196
197 Net::HTTP.get("www.example.com", '/') # ===> "abc"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
198
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
199 ### Response with body specified as IO object
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
200
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
201 File.open('/tmp/response_body.txt', 'w') { |f| f.puts 'abc' }
202
203 stub_request(:any, "www.example.com").to_return(:body => File.new('/tmp/response_body.txt'), :status => 200)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
204
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
205 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
206
3314aad Added support for status messages
Bartosz Blimke authored
207 ### Response with custom status message
208
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
209 stub_request(:any, "www.example.com").to_return(:status => [500, "Internal Server Error"])
210
211 req = Net::HTTP::Get.new("/")
212 Net::HTTP.start("www.example.com") { |http| http.request(req) }.message # ===> "Internal Server Error"
3314aad Added support for status messages
Bartosz Blimke authored
213
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
214 ### Replaying raw responses recorded with `curl -is`
215
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
216 `curl -is www.example.com > /tmp/example_curl_-is_output.txt`
217 raw_response_file = File.new("/tmp/example_curl_-is_output.txt")
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
218
219 from file
220
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
221 stub_request(:get, "www.example.com").to_return(raw_response_file)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
222
223 or string
224
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
225 stub_request(:get, "www.example.com").to_return(raw_response_file.read)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
226
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
227 ### Responses dynamically evaluated from block
228
4e0568a Added information about dynamic responses to README
Bartosz Blimke authored
229 stub_request(:any, 'www.example.net').
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
230 to_return { |request| {:body => request.body} }
4e0568a Added information about dynamic responses to README
Bartosz Blimke authored
231
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
232 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `cur...
authored
233
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
234 ### Responses dynamically evaluated from lambda
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `cur...
authored
235
5b1c97b @tomafro Added complete dynamic request, where headers, body and status can all b...
tomafro authored
236 stub_request(:any, 'www.example.net').
237 to_return(lambda { |request| {:body => request.body} })
238
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
239 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
4e0568a Added information about dynamic responses to README
Bartosz Blimke authored
240
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `cur...
authored
241 ### Dynamically evaluated raw responses recorded with `curl -is`
242
243 `curl -is www.example.com > /tmp/www.example.com.txt`
244 stub_request(:get, "www.example.com").to_return(lambda { |request| File.new("/tmp/#{request.uri.host.to_s}.txt" }))
245
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
246 ### Responses with dynamically evaluated parts
247
248 stub_request(:any, 'www.example.net').
249 to_return(:body => lambda { |request| request.body })
250
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
251 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
0f3bb21 Updated README regarding dynamic responses
Bartosz Blimke authored
252
c6974db @bblimke Added info about how to stub requests to respond with Rack app response.
authored
253 ### Rack responses
254
255 class MyRackApp
256 def self.call(env)
257 [200, {}, ["Hello"]]
258 end
259 end
260
261 stub_request(:get, "www.example.com").to_rack(MyRackApp)
262
263 RestClient.post('www.example.com') # ===> "Hello"
264
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
265 ### Raising errors
266
207443e `to_raise()` now accepts exception instance or a string as argument in a...
Bartosz Blimke authored
267 #### Exception declared by class
268
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
269 stub_request(:any, 'www.example.net').to_raise(StandardError)
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
270
271 RestClient.post('www.example.net', 'abc') # ===> StandardError
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
272
207443e `to_raise()` now accepts exception instance or a string as argument in a...
Bartosz Blimke authored
273 #### or by exception instance
274
275 stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
276
277 #### or by string
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
278
207443e `to_raise()` now accepts exception instance or a string as argument in a...
Bartosz Blimke authored
279 stub_request(:any, 'www.example.net').to_raise("some error")
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
280
281 ### Raising timeout errors
282
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
283 stub_request(:any, 'www.example.net').to_timeout
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
284
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
285 RestClient.post('www.example.net', 'abc') # ===> RestClient::RequestTimeout
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
286
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
287 ### Multiple responses for repeated requests
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
288
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
289 stub_request(:get, "www.example.com").to_return({:body => "abc"}, {:body => "def"})
290 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
291 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
292
293 #after all responses are used the last response will be returned infinitely
294
295 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
bb41263 Improved section about basic authentication support in readme.
Bartosz Blimke authored
296
af52fe7 Added support for declaring timeout errors using `to_timeout`
Bartosz Blimke authored
297 ### Multiple responses using chained `to_return()`, `to_raise()` or `to_timeout` declarations
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
298
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
299 stub_request(:get, "www.example.com").
300 to_return({:body => "abc"}).then. #then() is just a syntactic sugar
301 to_return({:body => "def"}).then.
302 to_raise(MyException)
303 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
304 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
305 Net::HTTP.get('www.example.com', '/') # ===> MyException raised
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
306
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
307 ### Specifying number of times given response should be returned
308
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
309 stub_request(:get, "www.example.com").
310 to_return({:body => "abc"}).times(2).then.
311 to_return({:body => "def"})
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
312
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
313 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
314 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
315 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
316
317
318 ### Real requests to network can be allowed or disabled
319
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
320 WebMock.allow_net_connect!
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
321
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
322 stub_request(:any, "www.example.com").to_return(:body => "abc")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
323
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
324 Net::HTTP.get('www.example.com', '/') # ===> "abc"
325
326 Net::HTTP.get('www.something.com', '/') # ===> /.+Something.+/
327
328 WebMock.disable_net_connect!
329
330 Net::HTTP.get('www.something.com', '/') # ===> Failure
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
331
8859deb @macksmind Change the locahost option syntax and update README
macksmind authored
332 ### External requests can be disabled while allowing localhost
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
333
334 WebMock.disable_net_connect!(:allow_localhost => true)
335
336 Net::HTTP.get('www.something.com', '/') # ===> Failure
337
338 Net::HTTP.get('localhost:9887', '/') # ===> Allowed. Perhaps to Selenium?
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
339
7a38e8a @thenoseman Allow Webmock.disable_net_connect! to accept a RegEx as :allow option
thenoseman authored
340 ### External requests can be disabled while allowing any hostname or port or parts thereof
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
341
e1d431e @bblimke Updated README with info about :allow with specified port number
authored
342 WebMock.disable_net_connect!(:allow => "www.example.org:8080")
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
343
e1d431e @bblimke Updated README with info about :allow with specified port number
authored
344 RestClient.get('www.something.com', '/') # ===> Failure
345
346 RestClient.get('www.example.org', '/') # ===> Failure.
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
347
e1d431e @bblimke Updated README with info about :allow with specified port number
authored
348 RestClient.get('www.example.org:8080', '/') # ===> Allowed
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
349
7a38e8a @thenoseman Allow Webmock.disable_net_connect! to accept a RegEx as :allow option
thenoseman authored
350 WebMock.disable_net_connect!(:allow => /ample.org/)
351
352 RestClient.get('www.example.org', '/') # ===> Allowed
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
353
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
354 ## Connecting on Net::HTTP.start
355
c92144f @bblimke Fixed text formatting in README
authored
356 HTTP protocol has 3 steps: connect, request and response (or 4 with close). Most Ruby HTTP client libraries
357 treat connect as a part of request step, with the exception of `Net::HTTP` which
358 allows opening connection to the server separately to the request, by using `Net::HTTP.start`.
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
359
c92144f @bblimke Fixed text formatting in README
authored
360 WebMock API was also designed with connect being part of request step, and it only allows stubbing
361 requests, not connections. When `Net::HTTP.start` is called, WebMock doesn't know yet whether
362 a request is stubbed or not. WebMock by default delays a connection until the request is invoked,
363 so when there is no request, `Net::HTTP.start` doesn't do anything.
364 **This means that WebMock breaks the Net::HTTP behaviour by default!**
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
365
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
366 To workaround this issue, WebMock offers `:net_http_connect_on_start` option,
367 which can be passed to `WebMock.allow_net_connect!` and `WebMock#disable_net_connect!` methods, i.e.
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
368
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
369 WebMock.allow_net_connect!(:net_http_connect_on_start => true)
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
370
c92144f @bblimke Fixed text formatting in README
authored
371 This forces WebMock Net::HTTP adapter to always connect on `Net::HTTP.start`.
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
372
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
373 ## Setting Expectations
374
375 ### Setting expectations in Test::Unit
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
376 require 'webmock/test_unit'
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
377
32c653c Replaced google with example in README
Bartosz Blimke authored
378 stub_request(:any, "www.example.com")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
379
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
380 uri = URI.parse('http://www.example.com/')
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
381 req = Net::HTTP::Post.new(uri.path)
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
382 req['Content-Length'] = 3
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
383 res = Net::HTTP.start(uri.host, uri.port) {|http|
384 http.request(req, 'abc')
385 }
386
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
387 assert_requested :post, "http://www.example.com",
388 :headers => {'Content-Length' => 3}, :body => "abc", :times => 1 # ===> Success
389
390 assert_not_requested :get, "http://www.something.com" # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
391
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
392 assert_requested(:post, "http://www.example.com", :times => 1) { |req| req.body == "abc" }
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
393
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
394 ### Expecting real (not stubbed) requests
395
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
396 WebMock.allow_net_connect!
397
398 Net::HTTP.get('www.example.com', '/') # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
399
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
400 assert_requested :get, "http://www.example.com" # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
401
84ef7a7 @nfo Added Test::Unit methods +assert_stub_requested+ and +assert_stub_not_re...
nfo authored
402 ### Setting expectations in Test::Unit on the stub
403
404 stub_get = stub_request(:get, "www.example.com")
405 stub_post = stub_request(:post, "www.example.com")
406
407 Net::HTTP.get('www.example.com', '/')
408
ed795fa @bblimke assert_requested and assert_not_requested can accept either method and u...
authored
409 assert_requested(stub_get)
410 assert_not_requested(stub_post)
84ef7a7 @nfo Added Test::Unit methods +assert_stub_requested+ and +assert_stub_not_re...
nfo authored
411
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
412
a6e0800 @afeld allow expectations to be set on the stub itself
afeld authored
413 ### Setting expectations in RSpec on `WebMock` module
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
414 This style is borrowed from [fakeweb-matcher](http://github.com/freelancing-god/fakeweb-matcher)
415
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
416 require 'webmock/rspec'
417
418 WebMock.should have_requested(:get, "www.example.com").with(:body => "abc", :headers => {'Content-Length' => 3}).twice
419
420 WebMock.should_not have_requested(:get, "www.something.com")
421
422 WebMock.should have_requested(:post, "www.example.com").with { |req| req.body == "abc" }
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
423
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
424 WebMock.should have_requested(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
fa4ab29 Updated README with info about setting expectations on query params or b...
Bartosz Blimke authored
425
2d03aca @bblimke Added support for matching partial query params with "hash_including"
authored
426 WebMock.should have_requested(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
427
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
428 WebMock.should have_requested(:get, "www.example.com").
c109d95 @fb3 Fixed syntax error in README examples
fb3 authored
429 with(:body => {"a" => ["b", "c"]}, :headers => {'Content-Type' => 'application/json'})
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
430
a6e0800 @afeld allow expectations to be set on the stub itself
afeld authored
431 ### Setting expectations in RSpec with `a_request`
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
432
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
433 a_request(:post, "www.example.com").with(:body => "abc", :headers => {'Content-Length' => 3}).should have_been_made.once
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
434
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
435 a_request(:post, "www.something.com").should have_been_made.times(3)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
436
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
437 a_request(:any, "www.example.com").should_not have_been_made
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
438
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
439 a_request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
6cb45ed @bblimke Renames WebMock#request to WebMock#a_request to avoid conflicts with i.e...
authored
440
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
441 a_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made
6cb45ed @bblimke Renames WebMock#request to WebMock#a_request to avoid conflicts with i.e...
authored
442
2d03aca @bblimke Added support for matching partial query params with "hash_including"
authored
443 a_request(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]})).should have_been_made
444
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
445 a_request(:post, "www.example.com").
c109d95 @fb3 Fixed syntax error in README examples
fb3 authored
446 with(:body => {"a" => ["b", "c"]}, :headers => {'Content-Type' => 'application/json'}).should have_been_made
6cb45ed @bblimke Renames WebMock#request to WebMock#a_request to avoid conflicts with i.e...
authored
447
a6e0800 @afeld allow expectations to be set on the stub itself
afeld authored
448 ### Setting expectations in RSpec on the stub
449
450 stub = stub_request(:get, "www.example.com")
451 # ... make requests ...
452 stub.should have_been_requested
453
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
454 ## Clearing stubs and request history
455
473b709 @bblimke Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
authored
456 If you want to reset all current stubs and history of requests use `WebMock.reset!`
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
457
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
458 stub_request(:any, "www.example.com")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
459
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
460 Net::HTTP.get('www.example.com', '/') # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
461
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
462 WebMock.reset!
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
463
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
464 Net::HTTP.get('www.example.com', '/') # ===> Failure
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
465
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
466 assert_not_requested :get, "www.example.com" # ===> Success
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
467
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling WebM...
authored
468 ## Disabling and enabling WebMock or only some http client adapters
469
470 WebMock.disable! #disable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
471 WebMock.disable!(:except => [:net_http]) #disable WebMock for all libs except Net::HTTP
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling WebM...
authored
472 WebMock.enable! #enable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
473 WebMock.enable!(:except => [:patron]) #enable WebMock for all libs except Patron
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling WebM...
authored
474
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
475
476 ## Matching requests
477
478 An executed request matches stubbed request if it passes following criteria:
479
4306efa Ability to register and expect requests with empty body.
Bartosz Blimke authored
480 When request URI matches stubbed request URI string or Regexp pattern<br/>
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
481 And request method is the same as stubbed request method or stubbed request method is :any<br/>
4306efa Ability to register and expect requests with empty body.
Bartosz Blimke authored
482 And request body is the same as stubbed request body or stubbed request body is not specified<br/>
0016b13 Minor changes to README
Bartosz Blimke authored
483 And request headers match stubbed request headers, or stubbed request headers match a subset of request headers, or stubbed request headers are not specified<br/>
484 And request matches provided block or block is not provided
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
485
486 ## Precedence of stubs
487
488 Always the last declared stub matching the request will be applied i.e:
489
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
490 stub_request(:get, "www.example.com").to_return(:body => "abc")
491 stub_request(:get, "www.example.com").to_return(:body => "def")
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
492
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
493 Net::HTTP.get('www.example.com', '/') # ====> "def"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
494
495 ## Matching URIs
496
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
497 WebMock will match all different representations of the same URI.
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
498
499 I.e all the following representations of the URI are equal:
500
32c653c Replaced google with example in README
Bartosz Blimke authored
501 "www.example.com"
502 "www.example.com/"
503 "www.example.com:80"
504 "www.example.com:80/"
505 "http://www.example.com"
506 "http://www.example.com/"
507 "http://www.example.com:80"
508 "http://www.example.com:80/"
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
509
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
510 The following URIs with basic authentication are also equal for WebMock
511
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
512 "a b:pass@www.example.com"
513 "a b:pass@www.example.com/"
514 "a b:pass@www.example.com:80"
515 "a b:pass@www.example.com:80/"
516 "http://a b:pass@www.example.com"
517 "http://a b:pass@www.example.com/"
518 "http://a b:pass@www.example.com:80"
519 "http://a b:pass@www.example.com:80/"
520 "a%20b:pass@www.example.com"
521 "a%20b:pass@www.example.com/"
522 "a%20b:pass@www.example.com:80"
523 "a%20b:pass@www.example.com:80/"
524 "http://a%20b:pass@www.example.com"
525 "http://a%20b:pass@www.example.com/"
526 "http://a%20b:pass@www.example.com:80"
527 "http://a%20b:pass@www.example.com:80/"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
528
529 or these
530
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
531 "www.example.com/my path/?a=my param&b=c"
532 "www.example.com/my%20path/?a=my%20param&b=c"
533 "www.example.com:80/my path/?a=my param&b=c"
534 "www.example.com:80/my%20path/?a=my%20param&b=c"
535 "http://www.example.com/my path/?a=my param&b=c"
536 "http://www.example.com/my%20path/?a=my%20param&b=c"
537 "http://www.example.com:80/my path/?a=my param&b=c"
538 "http://www.example.com:80/my%20path/?a=my%20param&b=c"
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
539
540
541 If you provide Regexp to match URI, WebMock will try to match it against every valid form of the same url.
542
78414b7 Improved examples with equality of URIs with the same parameters
Bartosz Blimke authored
543 I.e `/.*my param.*/` will match `www.example.com/my%20path` because it is equivalent of `www.example.com/my path`
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
544
545
546 ## Matching headers
547
548 WebMock will match request headers against stubbed request headers in the following situations:
549
550 1. Stubbed request has headers specified and request headers are the same as stubbed headers <br/>
551 i.e stubbed headers: `{ 'Header1' => 'Value1', 'Header1' => 'Value1' }`, requested: `{ 'Header1' => 'Value1', 'Header1' => 'Value1' }`
552
553 2. Stubbed request has headers specified and stubbed request headers are a subset of request headers <br/>
554 i.e stubbed headers: `{ 'Header1' => 'Value1' }`, requested: `{ 'Header1' => 'Value1', 'Header1' => 'Value1' }`
555
556 3. Stubbed request has no headers <br/>
557 i.e stubbed headers: `nil`, requested: `{ 'Header1' => 'Value1', 'Header1' => 'Value1' }`
558
559 WebMock normalises headers and treats all forms of same headers as equal:
560 i.e the following two sets of headers are equal:
561
562 `{ "Header1" => "value1", :content_length => 123, :X_CuStOm_hEAder => :value }`
563
564 `{ :header1 => "value1", "Content-Length" => 123, "x-cuSTOM-HeAder" => "value" }`
565
176482c Updated README with 1.1.0 changes
Bartosz Blimke authored
566 ## Recording real requests and responses and replaying them later
567
568 To record your application's real HTTP interactions and replay them later in tests you can use [VCR](http://github.com/myronmarston/vcr) with WebMock.
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
569
5331132 Updated README with information about request callbacks
Bartosz Blimke authored
570 ## Request callbacks
571
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
572 ####WebMock can invoke callbacks stubbed or real requests:
5331132 Updated README with information about request callbacks
Bartosz Blimke authored
573
574 WebMock.after_request do |request_signature, response|
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
575 puts "Request #{request_signature} was made and #{response} was returned"
5331132 Updated README with information about request callbacks
Bartosz Blimke authored
576 end
577
578 #### invoke callbacks for real requests only and except requests made with Patron
579
580 WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
581 puts "Request #{request_signature} was made and #{response} was returned"
5331132 Updated README with information about request callbacks
Bartosz Blimke authored
582 end
583
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
584 ## Bugs and Issues
585
586 Please submit them here [http://github.com/bblimke/webmock/issues](http://github.com/bblimke/webmock/issues)
587
588 ## Suggestions
589
590 If you have any suggestions on how to improve WebMock please send an email to the mailing list [groups.google.com/group/webmock-users](http://groups.google.com/group/webmock-users)
591
592 I'm particularly interested in how the DSL could be improved.
593
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
594 ## Development
595
596 In order to work on Webmock you first need to fork and clone the repo.
597 Please do any work on a dedicated branch and rebase against master
598 before sending a pull request.
599
600 #### Running Tests
601
602 We use RVM in order to test WebMock against 1.8.6, REE, 1.8.7, 1.9.2 and
603 jRuby. You can get RVM setup for WebMock development using the
604 following commands (if you don't have these version of Ruby installed
605 use `rvm install` to install each of them).
606
607 rvm use --create 1.8.6@webmock
608 gem install jeweler bundler
609 bundle install
610
611 rvm use --create ree@webmock
612 gem install jeweler bundler
613 bundle install
614
615 rvm use --create 1.8.7@webmock
616 gem install jeweler bundler
617 bundle install
618
619 rvm use --create 1.9.2@webmock
620 gem install jeweler bundler
621 bundle install
622
623 rvm use --create jruby@webmock
624 gem install jeweler bundler
625 bundle install
626
627 These commands will create a gemset named WebMock for each of the
628 supported versions of Ruby and `bundle install` all dependencies.
629
630 With the supported versions of Ruby installed RVM will run specs across
631 all version with just one command.
632
633 bundle exec rvm 1.8.6@webmock,ree@webmock,1.8.7@webmock,1.9.2@webmock,jruby@webmock rspec spec/**/*_spec.rb
634
635 This command is wrapped up in to a rake task and can be invoked like so:
636
637 rake spec:rubies
638
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
639 ## Credits
640
00424d9 Updated credits in README
Bartosz Blimke authored
641 The initial lines of this project were written during New Bamboo [Hack Day](http://blog.new-bamboo.co.uk/2009/11/13/hackday-results)
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
642 Thanks to my fellow [Bambinos](http://new-bamboo.co.uk/) for all the great suggestions!
643
00424d9 Updated credits in README
Bartosz Blimke authored
644 People who submitted patches and new features or suggested improvements. Many thanks to these people:
645
646 * Ben Pickles
647 * Mark Evans
648 * Ivan Vega
649 * Piotr Usewicz
650 * Nick Plante
651 * Nick Quaranto
652 * Diego E. "Flameeyes" Pettenò
653 * Niels Meersschaert
654 * Mack Earnhardt
655 * Arvicco
656 * Sergio Gil
657 * Jeffrey Jones
658 * Tekin Suleyman
659 * Tom Ward
660 * Nadim Bitar
ee7b3b4 Fixed spelling
Bartosz Blimke authored
661 * Myron Marston
9c8c463 Updated README with information about RSpec 2 support.
Bartosz Blimke authored
662 * Sam Phillips
2e88f99 Updated info on how to include WebMock in Test::Unit and RSpec without p...
Bartosz Blimke authored
663 * Jose Angel Cortinas
52698d8 Updated credits
Bartosz Blimke authored
664 * Razic
fd2472a Version 1.2.2 changelog
Bartosz Blimke authored
665 * Steve Tooke
fb18a01 Updated README with info about matching request body against hash
Bartosz Blimke authored
666 * Nathaniel Bibler
15f888e @bblimke The less hacky way to get the stream behaviour working for em-http-reque...
authored
667 * Martyn Loughran
60fa244 @bblimke Updated changelog
authored
668 * Muness Alrubaie
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
669 * Charles Li
670 * Ryan Bigg
aaf774b @bblimke Added info to changelog and readme about Curb support, implemented by Pe...
authored
671 * Pete Higgins
ffbcdb3 @bblimke Updated changelog with the latest changes in master branch
authored
672 * Hans de Graaff
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_on_...
authored
673 * Alastair Brunton
e6af079 @bblimke Updated 1.6.2 changelog and credits
authored
674 * Sam Stokes
675 * Eugene Bolshakov
7fd377b @bblimke Updated list of contributors in README
authored
676 * James Conroy-Finn
677 * Salvador Fuentes Jr
678 * Alex Rothenberg
679 * Aidan Feldman
680 * Steve Hull
681 * Jay Adkisson
682 * Zach Dennis
683 * Nikita Fedyashev
684 * Lin Jen-Shin
b6ca337 @bblimke Version 1.7.4
authored
685 * David Yeu
4d848df @bblimke Version 1.7.5
authored
686 * Andreas Garnæs
748ff35 @bblimke Version 1.7.6
authored
687 * Roman Shterenzon
4ff9f1a @bblimke Version 1.7.7 - RuPy 2011 Release
authored
688 * Chris McGrath
689 * Stephen Celis
690 * Eugene Pimenov
4ff8cf1 @bblimke Version 1.7.9 changelog
authored
691 * Albert Llop
692 * Christopher Pickslay
68ba906 @bblimke Updated Changelog and Readme with the latest changes in master
authored
693 * Tammer Saleh
694 * Nicolas Fouché
695 * Joe Van Dyk
696 * Mark Abramov
697 * Frank Schumacher
698 * Dimitrij Denissenko
699 * Marnen Laibow-Koser
5cd5aaf @bblimke Fixed problem with body params being matched even if params were differe...
authored
700 * Evgeniy Dolzhenko
3876948 @bblimke Update to version 1.8.2
authored
701 * Nick Recobra
702 * Jordan Elver
703 * Joe Karayusuf
3c9b625 @bblimke Bump version to 1.8.3
authored
704 * Paul Cortens
576c596 @bblimke Bump to version 1.8.5
authored
705 * jugyo
4711a0b @bblimke Bump version to 1.8.6
authored
706 * aindustries
707 * Eric Oestrich
d083e68 @bblimke Bump to version 1.8.7
authored
708 * erwanlr
709 * Ben Bleything
5fa0c99 @bblimke Bump version to 1.8.8
authored
710 * Jon Leighton
711 * Ryan Schlesinger
712 * Julien Boyer
713 * Kevin Glowacz
714 * Hans Hasselberg
00424d9 Updated credits in README
Bartosz Blimke authored
715
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
716 For a full list of contributors you can visit the
717 [contributors](https://github.com/bblimke/webmock/contributors) page.
718
00424d9 Updated credits in README
Bartosz Blimke authored
719 ## Background
720
ff32ec5 @jordelver Fix FakeWeb URL
jordelver authored
721 Thank you Fakeweb! This library was inspired by [FakeWeb](http://fakeweb.rubyforge.org).
221e8cd @jcf Document setting up a WebMock development environment
jcf authored
722 I imported some solutions from that project to WebMock. I also copied some code i.e Net:HTTP adapter.
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
723 Fakeweb architecture unfortunately didn't allow me to extend it easily with the features I needed.
724 I also preferred some things to work differently i.e request stub precedence.
725
726 ## Copyright
727
bf18e89 Changed license from GPL to MIT
Bartosz Blimke authored
728 Copyright (c) 2009-2010 Bartosz Blimke. See LICENSE for details.
Something went wrong with that request. Please try again.