Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated CHANGELOG width version 1.3.0 changes

  • Loading branch information...
commit 354af66a337c02c756e747774e9c1e30b87826f0 1 parent 098c2cc
Bartosz Blimke authored
Showing with 59 additions and 4 deletions.
  1. +55 −0 CHANGELOG.md
  2. +4 −4 README.md
View
55 CHANGELOG.md
@@ -1,5 +1,60 @@
#Changelog
+## 1.3.0
+
+* Added support for [em-http-request](http://github.com/igrigorik/em-http-request)
+
+* Matching query params using a hash
+
+ stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
+
+ RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
+
+ request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made # ===> Success
+
+* Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
+ (Thanks to Steve Tooke for the idea and a solution for url-encoded bodies)
+
+ stub_http_request(:post, "www.example.com").
+ with(:body => {:data => {:a => '1', :b => 'five'}})
+
+ RestClient.post('www.example.com', "data[a]=1&data[b]=five",
+ :content_type => 'application/x-www-form-urlencoded') # ===> Success
+
+ RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
+ :content_type => 'application/json') # ===> Success
+
+ RestClient.post('www.example.com', '<data a="1" b="five" />',
+ :content_type => 'application/xml' ) # ===> Success
+
+ request(:post, "www.example.com").
+ with(:body => {:data => {:a => '1', :b => 'five'}},
+ :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
+
+* Request callbacks (Thanks to Myron Marston for all suggestions)
+
+ WebMock can now invoke callbacks for stubbed or real requests:
+
+ WebMock.after_request do |request_signature, response|
+ puts "Request #{request_signature} was made and #{response} was returned"
+ end
+
+ invoke callbacks for real requests only and except requests made with Patron client
+
+ WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
+ puts "Request #{request_signature} was made and #{response} was returned"
+ end
+
+* `to_raise()` now accepts an exception instance or a string as argument in addition to an exception class
+
+ stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
+
+ stub_request(:any, 'www.example.net').to_raise("some error")
+
+* Matching request stubs based on a URI is 30% faster
+
+* Fixed constant namespace issues in HTTPClient adapter. Thanks to Nathaniel Bibler for submitting a patch.
+
## 1.2.2
* Fixed problem where ArgumentError was raised if query params were made up of an array e.g. data[]=a&data[]=b. Thanks to Steve Tooke
View
8 README.md
@@ -85,7 +85,7 @@ You can also use WebMock without RSpec or Test::Unit support:
http.request(req, 'hello world')
} # ===> Success
-### Matching requests with URL-Encoded, JSON or XML body against hash
+### Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
stub_http_request(:post, "www.example.com").
with(:body => {:data => {:a => '1', :b => 'five'}})
@@ -448,16 +448,16 @@ To record your application's real HTTP interactions and replay them later in tes
## Request callbacks
-####WebMock can invoke a callback for each, stubbed or real, request:
+####WebMock can invoke callbacks stubbed or real requests:
WebMock.after_request do |request_signature, response|
- Log.info("Request #{request_signature} was made and #{response} was returned")
+ puts "Request #{request_signature} was made and #{response} was returned"
end
#### invoke callbacks for real requests only and except requests made with Patron
WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
- Log.info("Request #{request_signature} was made and #{response} was returned")
+ puts "Request #{request_signature} was made and #{response} was returned"
end
## Bugs and Issues
Please sign in to comment.
Something went wrong with that request. Please try again.