Created
August 22, 2013 01:19
-
-
Save Kimtaro/6302211 to your computer and use it in GitHub Desktop.
Moneky patch to force Webmock to always puts when it disallows a request. This works around overly eager rescue statements hiding the Webmock NetConnectNotAllowedError.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encoding: UTF-8 | |
module WebMock | |
class NetConnectNotAllowedError | |
def initialize_with_puts(request_signature) | |
begin | |
raise initialize_without_puts(request_signature) | |
rescue => e | |
puts "< ===== WEBMOCK WEBMOCK WEBMOCK WEBMOCK WEBMOCK ===== >", e.inspect | |
e | |
end | |
end | |
alias_method_chain :initialize, :puts | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment