Sha256: 8c9e6da9fabcc6f887b01726121159c602231221a6632a1da68ddd14af684a0f

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe Sekken::WSDL do

  subject(:wsdl) { Sekken::WSDL.new fixture('wsdl/authentication'), http_mock }

  let(:operation_name) { 'authenticate' }
  let(:service_name)   { 'AuthenticationWebServiceImplService' }
  let(:port_name)      { 'AuthenticationWebServiceImplPort' }

  describe '#service_name' do
    it 'returns the name of the service' do
      expect(wsdl.service_name).to eq('AuthenticationWebServiceImplService')
    end
  end

  describe '#services' do
    it 'returns a map of services and ports' do
      expect(wsdl.services).to eq(
        'AuthenticationWebServiceImplService' => {
          :ports => {
            'AuthenticationWebServiceImplPort' => {
              :type     => 'http://schemas.xmlsoap.org/wsdl/soap/',
              :location => 'http://example.com/validation/1.0/AuthenticationService'
            }
          }
        }
      )
    end
  end

  describe '#operations' do
    it 'returns an Array of operation names' do
      operations = wsdl.operations(service_name, port_name)
      expect(operations).to eq([operation_name])
    end
  end

  describe '#operation' do
    it 'returns a single operation by name' do
      operation = wsdl.operation(service_name, port_name, operation_name)
      expect(operation).to be_a(Sekken::WSDL::Operation)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sekken-0.3.0 spec/sekken/wsdl_spec.rb
sekken-0.2.0 spec/sekken/wsdl_spec.rb
sekken-0.1.0 spec/sekken/wsdl_spec.rb