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