Sha256: 48e87bcae2d82dc77650735e31cd5a15983eebd3faf6634ee19cd2a313005006

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Wasabi::Parser do
  context 'with: no_message_parts.wsdl' do

    subject do
      parser = Wasabi::Parser.new Nokogiri::XML(xml)
      parser.parse
      parser
    end

    let(:xml) { fixture(:no_message_parts).read }

    it 'falls back to using the message type in the port element' do
      # Operation's input has no part element in the message, so using the message type.
      expect(subject.operations[:save][:input]).to eq('Save')

      # Operation's output has part element in the message, so using part element's type.
      expect(subject.operations[:save][:output]).to eq('SaveResponse')
    end

    it 'falls back to using the namespace ID in the port element' do
      expect(subject.operations[:save][:namespace_identifier]).to eq('actions')
    end

    it 'gracefully handles port messages without a colon' do
      expect(subject.operations[:delete][:input]).to eq('Delete')
      expect(subject.operations[:delete][:output]).to eq('DeleteResponse')
      expect(subject.operations[:delete][:namespace_identifier]).to be_nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wasabi-3.6.1 spec/wasabi/parser/no_message_parts_spec.rb
wasabi-3.6.0 spec/wasabi/parser/no_message_parts_spec.rb