lib/pipekit/webmock/errors.rb in pipekit-webmock-0.3.0 vs lib/pipekit/webmock/errors.rb in pipekit-webmock-0.4.0

- old
+ new

@@ -6,13 +6,20 @@ module Pipekit module WebMock class UnregisteredPipedriveRequestError < StandardError WebMockNetConnectNotAllowedError = ::WebMock::NetConnectNotAllowedError unless const_defined?(:WebMockNetConnectNotAllowedError) - def initialize(request_signature) + def self.new(*args) + request_signature = args[0] request_signature_snippet = RequestSignatureSnippet.new(request_signature) return WebMockNetConnectNotAllowedError.new(request_signature) unless request_signature_snippet.pipedrive_request? + super(request_signature) + end + + def initialize(request_signature) + request_signature_snippet = RequestSignatureSnippet.new(request_signature) + text = [ "Unregistered request to Pipedrive: #{request_signature}", "with params:", request_signature_snippet.params, "and body:",