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