Sha256: ef0df9743a0ac1bf699c2419ffcaf53df3147a5c8a4e7d42aac989a5cb1b0915

Contents?: true

Size: 968 Bytes

Versions: 2

Compression:

Stored size: 968 Bytes

Contents

require "spec_helper"

describe Wasabi::Parser do
  context "with: multiple_namespaces.wsdl" do

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

    let(:xml) { fixture(:multiple_namespaces) }

    it "lists the types" do
      subject.types.keys.sort.should == ["Article", "Save"]
    end

    it "records the namespace for each type" do
      subject.types["Save"][:namespace].should == "http://example.com/actions"
    end

    it "records the fields under a type" do
      subject.types["Save"].keys.should =~ ["article", :namespace]
    end

    it "records multiple fields when there are more than one" do
      subject.types["Article"].keys.should =~ ["Title", "Author", :namespace]
    end

    it "records the type of a field" do
      subject.types["Save"]["article"][:type].should == "article:Article"
      subject.namespaces["article"].should == "http://example.com/article"
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wasabi-2.3.0 spec/wasabi/parser/multiple_namespaces_spec.rb
wasabi-2.2.0 spec/wasabi/parser/multiple_namespaces_spec.rb