Skip to content

HTTPS clone URL

Subversion checkout URL

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