Skip to content

savon gem test failure: ArgumentError: unknown keyword: code #2298

@gogainda

Description

@gogainda
Savon::Operation.create with a WSDL raises if the endpoint cannot be reached
     Failure/Error:
       expect { new_operation(:verify_address, wsdl, globals) }.
         to raise_error(Savon::HTTPError, /#{message}/)
     
       expected Savon::HTTPError with message matching /Error!/, got #<ArgumentError: unknown keyword: code> with backtrace:
         # <internal:core> core/kernel.rb:686:in `raise'
         # ./lib/savon/operation.rb:34:in `ensure_exists!'
         # ./lib/savon/operation.rb:22:in `create'
         # ./spec/savon/operation_spec.rb:22:in `new_operation'
         # ./spec/savon/operation_spec.rb:55:in `block (4 levels) in <top (required)>'
         # ./spec/savon/operation_spec.rb:55:in `block (3 levels) in <top (required)>'

This is the place where issue appears:

def self.ensure_exists!(operation_name, wsdl)
      unless wsdl.soap_actions.include? operation_name
        raise UnknownOperationError, "Unable to find SOAP operation: #{operation_name.inspect}\n" \
                                     "Operations provided by your service: #{wsdl.soap_actions.inspect}"
      end
    rescue Wasabi::Resolver::HTTPError => e
      raise HTTPError.new(e.response)
    end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions