Sha256: 6835a7942eed894b04fb11b2b3c8835d0f988b07bdba3dcdcdbb2ec90f9d4773

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

require 'helper'
require 'lolsoap/wsdl'

module LolSoap
  describe WSDL do
    subject { WSDL.parse(File.read(TEST_ROOT + '/fixtures/stock_quote.wsdl')) }

    it 'should successfully parse a WSDL document' do
      subject.operations.length.must_equal 2
      subject.operations.fetch('GetLastTradePrice').tap do |o|
        o.input.header.tap do |header|
          header.name.must_equal 'Header'
          header.content.must_equal nil
          header.content_type.elements.keys.size.must_equal 2
          header.content_type.elements.keys.first.must_equal 'tradePriceRequestHeader'
          header.content_type.elements.keys.last.must_equal 'authentication'
        end
        o.input.body.name.must_equal 'Body'
        o.input.body.content.name.must_equal 'tradePriceRequest'
        o.action.must_equal 'http://example.com/GetLastTradePrice'
      end

      subject.operations.fetch('GetHistoricalPrice').tap do |o|
        o.input.header.name.must_equal 'Header'
        o.input.header.content.must_equal nil
        o.input.header.content_type.class.must_equal WSDL::NullType
        o.input.body.name.must_equal 'Body'
        o.input.body.content.name.must_equal 'historicalPriceRequest'
      end

      subject.types.length.must_equal 4
      subject.types.fetch('TradePriceRequest').tap do |t|
        t.prefix.must_equal 'ns0'
      end
    end

    describe '#inspect' do
      it 'works' do
        subject.inspect
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lolsoap-0.9.0 test/integration/test_wsdl.rb
lolsoap-0.8.3 test/integration/test_wsdl.rb
lolsoap-0.8.2 test/integration/test_wsdl.rb
lolsoap-0.8.1 test/integration/test_wsdl.rb
lolsoap-0.8.0 test/integration/test_wsdl.rb
lolsoap-0.7.0 test/integration/test_wsdl.rb