Permalink
Browse files

Updated Changelog and README with info about enabling and disabling W…

…ebMock with WebMock.enable! and WebMock.disable!
  • Loading branch information...
1 parent 7c930d1 commit 17547a564a9ae81eb2e41f495002f02f8a854e30 @bblimke committed Aug 13, 2011
Showing with 14 additions and 0 deletions.
  1. +7 −0 CHANGELOG.md
  2. +7 −0 README.md
View
@@ -32,6 +32,13 @@
Thanks to [Jay Adkisson](https://github.com/jayferd)
+* Added support for selective disabling and enabling of http client adapters
+
+ WebMock.disable! #disable WebMock (all adapters)
+ WebMock.disable!(:except => [:net_http]) #disable all adapters except Net::HTTP
+ WebMock.enable! #enable WebMock (all adapters)
+ WebMock.enable!(:except => [:patron]) #enable all adapters except Patron
+
* The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form. Thanks to [Alex Rothenberg](https://github.com/alexrothenberg)
* The error message on an unstubbed request shows currently registered request stubs.
View
@@ -429,6 +429,13 @@ If you want to reset all current stubs and history of requests use `WebMock.rese
assert_not_requested :get, "www.example.com" # ===> Success
+## Disabling and enabling WebMock or only some http client adapters
+
+ WebMock.disable! #disable WebMock (all adapters)
+ WebMock.disable!(:except => [:net_http]) #disable all adapters except Net::HTTP
+ WebMock.enable! #enable WebMock (all adapters)
+ WebMock.enable!(:except => [:patron]) #enable all adapters except Patron
+
## Matching requests

0 comments on commit 17547a5

Please sign in to comment.