Previously it was called 2 or even 3 times for one request, which made it difficult to put any behavior in the hook besides returning true or false as you had to keep track of the request to see if the hook was being called again for the same request.
…on with Patron on Travis CI
The real curb calls on_failure when response code is 4xx, so this commit matches the behavior in the webmock.
…eplaced `Net::HTTP` to make it possible to marshal objects with these constants assigned to properties. It looks like `Marshal` doesn't use const_get or consttants methods.
…return same values as original `Net::HTTP`
… true if constant is defined on the original Net::HTTP. This is only for Ruby 1.8 since Ruby 1.9 by default looks for a const in ancestors.
…WebMock.disable!(:except => [:net_http])
…ses many class instance variables, so I didn't use inheritance and const replacement in this case)