Skip to content

HTTPS clone URL

Subversion checkout URL

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