wasabi 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +32 -0
- data/README.md +10 -11
- data/lib/wasabi/core_ext/string.rb +7 -8
- data/lib/wasabi/document.rb +2 -0
- data/lib/wasabi/parser.rb +14 -17
- data/lib/wasabi/resolver.rb +2 -0
- data/lib/wasabi/version.rb +3 -1
- data/lib/wasabi.rb +2 -0
- metadata +18 -135
- data/.gitignore +0 -8
- data/.rspec +0 -1
- data/.travis.yml +0 -7
- data/Gemfile +0 -13
- data/Rakefile +0 -7
- data/spec/fixtures/authentication.wsdl +0 -63
- data/spec/fixtures/economic.wsdl +0 -65660
- data/spec/fixtures/encoded_endpoint.wsdl +0 -52
- data/spec/fixtures/geotrust.wsdl +0 -156
- data/spec/fixtures/import_port_types.wsdl +0 -86
- data/spec/fixtures/inherited.wsdl +0 -46
- data/spec/fixtures/juniper.wsdl +0 -215
- data/spec/fixtures/lower_camel.wsdl +0 -52
- data/spec/fixtures/marketo.wsdl +0 -1630
- data/spec/fixtures/multiple_namespaces.wsdl +0 -61
- data/spec/fixtures/multiple_parts_in_message.wsdl +0 -66
- data/spec/fixtures/multiple_types.wsdl +0 -60
- data/spec/fixtures/namespaced_actions.wsdl +0 -307
- data/spec/fixtures/no_message_parts.wsdl +0 -85
- data/spec/fixtures/no_namespace.wsdl +0 -115
- data/spec/fixtures/savon295.wsdl +0 -52
- data/spec/fixtures/soap12.wsdl +0 -11
- data/spec/fixtures/symbolic_endpoint.wsdl +0 -190
- data/spec/fixtures/tradetracker.wsdl +0 -1330
- data/spec/fixtures/two_bindings.wsdl +0 -24
- data/spec/spec_helper.rb +0 -19
- data/spec/support/adapter.rb +0 -18
- data/spec/support/fixture.rb +0 -40
- data/spec/support/profiling.rb +0 -18
- data/spec/wasabi/core_ext/string_spec.rb +0 -37
- data/spec/wasabi/document/authentication_spec.rb +0 -37
- data/spec/wasabi/document/economic_spec.rb +0 -13
- data/spec/wasabi/document/encoded_endpoint_spec.rb +0 -14
- data/spec/wasabi/document/geotrust_spec.rb +0 -38
- data/spec/wasabi/document/inherited_spec.rb +0 -41
- data/spec/wasabi/document/multiple_namespaces_spec.rb +0 -55
- data/spec/wasabi/document/namespaced_actions_spec.rb +0 -39
- data/spec/wasabi/document/no_namespace_spec.rb +0 -39
- data/spec/wasabi/document/savon295_spec.rb +0 -18
- data/spec/wasabi/document/soap12_spec.rb +0 -14
- data/spec/wasabi/document/two_bindings_spec.rb +0 -29
- data/spec/wasabi/document_spec.rb +0 -58
- data/spec/wasabi/parser/get_servicename_spec.rb +0 -19
- data/spec/wasabi/parser/import_port_types_spec.rb +0 -22
- data/spec/wasabi/parser/juniper_spec.rb +0 -23
- data/spec/wasabi/parser/marketo_spec.rb +0 -17
- data/spec/wasabi/parser/multiple_namespaces_spec.rb +0 -40
- data/spec/wasabi/parser/multiple_parts_in_message_spec.rb +0 -31
- data/spec/wasabi/parser/no_message_parts_spec.rb +0 -32
- data/spec/wasabi/parser/no_namespace_spec.rb +0 -26
- data/spec/wasabi/parser/no_target_namespace_spec.rb +0 -36
- data/spec/wasabi/parser/symbolic_endpoint_spec.rb +0 -24
- data/spec/wasabi/parser/tradetracker_spec.rb +0 -17
- data/spec/wasabi/resolver_spec.rb +0 -55
- data/spec/wasabi/wasabi_spec.rb +0 -12
- data/wasabi.gemspec +0 -28
@@ -1,24 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Example of a WSDL with two <binding> tags.
|
3
|
-
|
4
|
-
This is stripped down from a real example found in the wild, although
|
5
|
-
having different operations for the SOAP 1.1 and SOAP 1.2 bindings
|
6
|
-
is hypothetical (the real-world example I saw had the same operations
|
7
|
-
in each binding section). -->
|
8
|
-
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
9
|
-
<types>
|
10
|
-
</types>
|
11
|
-
<portType name="BlogSoap">
|
12
|
-
</portType>
|
13
|
-
<binding name="BlogSoap">
|
14
|
-
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
15
|
-
<operation name="Post" />
|
16
|
-
<operation name="Post11only" />
|
17
|
-
</binding>
|
18
|
-
<binding name="BlogSoap12">
|
19
|
-
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
20
|
-
<operation name="Post" />
|
21
|
-
<operation name="Post12only" />
|
22
|
-
</binding>
|
23
|
-
</definitions>
|
24
|
-
|
data/spec/spec_helper.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require "bundler"
|
2
|
-
Bundler.require :default, :development
|
3
|
-
|
4
|
-
unless RUBY_PLATFORM =~ /java/
|
5
|
-
require "simplecov"
|
6
|
-
require "coveralls"
|
7
|
-
|
8
|
-
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
9
|
-
SimpleCov.start do
|
10
|
-
add_filter "spec"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
support_files = File.expand_path("spec/support/**/*.rb")
|
15
|
-
Dir[support_files].each { |file| require file }
|
16
|
-
|
17
|
-
RSpec.configure do |config|
|
18
|
-
config.include SpecSupport
|
19
|
-
end
|
data/spec/support/adapter.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
class FakeAdapterForTest < HTTPI::Adapter::Base
|
2
|
-
|
3
|
-
register :fake_adapter_for_test
|
4
|
-
|
5
|
-
def initialize(request)
|
6
|
-
@@requests ||= []
|
7
|
-
@@requests.push request
|
8
|
-
@request = request
|
9
|
-
end
|
10
|
-
|
11
|
-
attr_reader :client
|
12
|
-
|
13
|
-
def request(method)
|
14
|
-
@@methods ||= []
|
15
|
-
@@methods.push method
|
16
|
-
HTTPI::Response.new(200, {}, 'wsdl_by_adapter')
|
17
|
-
end
|
18
|
-
end
|
data/spec/support/fixture.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
module SpecSupport
|
2
|
-
|
3
|
-
class Fixture
|
4
|
-
def self.[](name)
|
5
|
-
fixtures[name]
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.[]=(name, value)
|
9
|
-
fixtures[name] = value
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.fixtures
|
13
|
-
@fixtures ||= {}
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(file, ext = :wsdl)
|
17
|
-
self.file = file
|
18
|
-
self.ext = ext
|
19
|
-
end
|
20
|
-
|
21
|
-
attr_accessor :file, :ext
|
22
|
-
|
23
|
-
def filename
|
24
|
-
"#{file}.#{ext}"
|
25
|
-
end
|
26
|
-
|
27
|
-
def path
|
28
|
-
File.expand_path("spec/fixtures/#{filename}")
|
29
|
-
end
|
30
|
-
|
31
|
-
def read
|
32
|
-
Fixture[filename] ||= File.read(path)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def fixture(*args)
|
37
|
-
Fixture.new(*args)
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
data/spec/support/profiling.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module SpecSupport
|
2
|
-
|
3
|
-
def benchmark(&block)
|
4
|
-
require 'benchmark'
|
5
|
-
|
6
|
-
puts "Benchmark:"
|
7
|
-
puts Benchmark.measure(&block)
|
8
|
-
end
|
9
|
-
|
10
|
-
def profile_methods
|
11
|
-
require 'method_profiler'
|
12
|
-
|
13
|
-
profiler = MethodProfiler.observe(Wasabi::Parser)
|
14
|
-
yield
|
15
|
-
puts profiler.report
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe String do
|
4
|
-
|
5
|
-
describe "#snakecase" do
|
6
|
-
it "lowercases one word CamelCase" do
|
7
|
-
expect("Merb".snakecase).to eq("merb")
|
8
|
-
end
|
9
|
-
|
10
|
-
it "makes one underscore snakecase two word CamelCase" do
|
11
|
-
expect("MerbCore".snakecase).to eq("merb_core")
|
12
|
-
end
|
13
|
-
|
14
|
-
it "handles CamelCase with more than 2 words" do
|
15
|
-
expect("SoYouWantContributeToMerbCore".snakecase).to eq("so_you_want_contribute_to_merb_core")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "handles CamelCase with more than 2 capital letter in a row" do
|
19
|
-
expect("CNN".snakecase).to eq("cnn")
|
20
|
-
expect("CNNNews".snakecase).to eq("cnn_news")
|
21
|
-
expect("HeadlineCNNNews".snakecase).to eq("headline_cnn_news")
|
22
|
-
end
|
23
|
-
|
24
|
-
it "does NOT change one word lowercase" do
|
25
|
-
expect("merb".snakecase).to eq("merb")
|
26
|
-
end
|
27
|
-
|
28
|
-
it "leaves snake_case as is" do
|
29
|
-
expect("merb_core".snakecase).to eq("merb_core")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "converts period characters to underscores" do
|
33
|
-
expect("User.GetEmail".snakecase).to eq("user_get_email")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: authentication.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:authentication).read }
|
7
|
-
|
8
|
-
describe '#namespace' do
|
9
|
-
subject { super().namespace }
|
10
|
-
it { should == "http://v1_0.ws.auth.order.example.com/" }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#endpoint' do
|
14
|
-
subject { super().endpoint }
|
15
|
-
it { should == URI("http://example.com/validation/1.0/AuthenticationService") }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#element_form_default' do
|
19
|
-
subject { super().element_form_default }
|
20
|
-
it { should == :unqualified }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'has 1 operation' do
|
24
|
-
expect(subject.operations.size).to eq(1)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#operations' do
|
28
|
-
subject { super().operations }
|
29
|
-
it do
|
30
|
-
should == {
|
31
|
-
:authenticate => { :input => "authenticate", :output => "authenticateResponse", :action => "authenticate", :namespace_identifier => "tns" }
|
32
|
-
}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context 'with: economic.wsdl' do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:economic).read }
|
7
|
-
|
8
|
-
it 'has an ok parse-time for huge wsdl files' do
|
9
|
-
expect(subject.operations.count).to eq(1511)
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: encoded_endpoint.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:encoded_endpoint).read }
|
7
|
-
|
8
|
-
describe '#endpoint' do
|
9
|
-
subject { super().endpoint }
|
10
|
-
it { should == URI("http://localhost/soapservice/execute?path=/base/includes/Test+Soap/Return+Rows") }
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: geotrust.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:geotrust).read }
|
7
|
-
|
8
|
-
describe '#namespace' do
|
9
|
-
subject { super().namespace }
|
10
|
-
it { should == "http://api.geotrust.com/webtrust/query" }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#endpoint' do
|
14
|
-
subject { super().endpoint }
|
15
|
-
it { should == URI("https://test-api.geotrust.com:443/webtrust/query.jws") }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#element_form_default' do
|
19
|
-
subject { super().element_form_default }
|
20
|
-
it { should == :qualified }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'has 2 operations' do
|
24
|
-
expect(subject.operations.size).to eq(2)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#operations' do
|
28
|
-
subject { super().operations }
|
29
|
-
it do
|
30
|
-
should include(
|
31
|
-
{ :get_quick_approver_list => { :input => "GetQuickApproverList", :action => "GetQuickApproverList", :parameters=>{:Request=>{:name=>"Request", :type=>"GetQuickApproverListInput"}}}},
|
32
|
-
{ :hello => { :input => "hello", :action => "hello", :parameters=>{:Input=>{:name=>"Input", :type=>"string"}} } }
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: inherited.xml" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:inherited).read }
|
7
|
-
|
8
|
-
describe '#type_definitions' do
|
9
|
-
subject { super().type_definitions }
|
10
|
-
it do
|
11
|
-
should include([["Account", "Id"], "ID"])
|
12
|
-
should include([["Account", "ProcessId"], "ID"])
|
13
|
-
should include([["Account", "CreatedDate"], "dateTime"])
|
14
|
-
should include([["Account", "Description"], "string"])
|
15
|
-
should include([["Account", "fieldsToNull"], "string"])
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should position base class attributes before subclass attributes in :order! array" do
|
20
|
-
account = subject.parser.types["Account"]
|
21
|
-
expect(account[:order!]).to eq(["fieldsToNull", "Id", "Description", "ProcessId", "CreatedDate"])
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should have each type's hash remember it's base type in :base_type element" do
|
25
|
-
account = subject.parser.types["Account"]
|
26
|
-
expect(account[:base_type]).to eq("baseObject")
|
27
|
-
|
28
|
-
base_object = subject.parser.types["baseObject"]
|
29
|
-
expect(base_object).not_to have_key(:base_type)
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should have element's hash contain all these attributes (:nillable, :minOccurs, :maxOccurs) in addition to :type" do
|
33
|
-
base_object = subject.parser.types["baseObject"]
|
34
|
-
fields_to_null = base_object["fieldsToNull"]
|
35
|
-
expect(fields_to_null[:nillable]).to eq("true")
|
36
|
-
expect(fields_to_null[:minOccurs]).to eq("0")
|
37
|
-
expect(fields_to_null[:maxOccurs]).to eq("unbounded")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: multiple_namespaces.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:multiple_namespaces).read }
|
7
|
-
|
8
|
-
describe '#namespace' do
|
9
|
-
subject { super().namespace }
|
10
|
-
it { should == "http://example.com/actions" }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#endpoint' do
|
14
|
-
subject { super().endpoint }
|
15
|
-
it { should == URI("http://example.com:1234/soap") }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#element_form_default' do
|
19
|
-
subject { super().element_form_default }
|
20
|
-
it { should == :qualified }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'has 1 operation' do
|
24
|
-
expect(subject.operations.size).to eq(1)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#operations' do
|
28
|
-
subject { super().operations }
|
29
|
-
it do
|
30
|
-
should == { :save => { :input => "Save", :output=>"SaveResponse", :action => "http://example.com/actions.Save", :namespace_identifier => "actions", :parameters => { :article => { :name => "article", :type => "Article" } } } }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '#type_namespaces' do
|
35
|
-
subject { super().type_namespaces }
|
36
|
-
it do
|
37
|
-
should =~ [
|
38
|
-
[["Save"], "http://example.com/actions"],
|
39
|
-
[["Save", "article"], "http://example.com/actions"],
|
40
|
-
[["Article"], "http://example.com/article"],
|
41
|
-
[["Article", "Author"], "http://example.com/article"],
|
42
|
-
[["Article", "Title"], "http://example.com/article"]
|
43
|
-
]
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe '#type_definitions' do
|
48
|
-
subject { super().type_definitions }
|
49
|
-
it do
|
50
|
-
should =~ [ [["Save", "article"], "Article"] ]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: namespaced_actions.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:namespaced_actions).read }
|
7
|
-
|
8
|
-
describe '#namespace' do
|
9
|
-
subject { super().namespace }
|
10
|
-
it { should == "http://api.example.com/api/" }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#endpoint' do
|
14
|
-
subject { super().endpoint }
|
15
|
-
it { should == URI("https://api.example.com/api/api.asmx") }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#element_form_default' do
|
19
|
-
subject { super().element_form_default }
|
20
|
-
it { should == :qualified }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'has 3 operations' do
|
24
|
-
expect(subject.operations.size).to eq(3)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#operations' do
|
28
|
-
subject { super().operations }
|
29
|
-
it do
|
30
|
-
should include(
|
31
|
-
{ :delete_client => { :input => "Client.Delete", :output => "Client.DeleteResponse", :action => "http://api.example.com/api/Client.Delete", :namespace_identifier => "tns" } },
|
32
|
-
{ :get_clients => { :input => "User.GetClients", :output => "User.GetClientsResponse", :action => "http://api.example.com/api/User.GetClients", :namespace_identifier => "tns" } },
|
33
|
-
{ :get_api_key => { :input => "User.GetApiKey", :output => "User.GetApiKeyResponse", :action => "http://api.example.com/api/User.GetApiKey", :namespace_identifier => "tns" } }
|
34
|
-
)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: no_namespace.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:no_namespace).read }
|
7
|
-
|
8
|
-
describe '#namespace' do
|
9
|
-
subject { super().namespace }
|
10
|
-
it { should == "urn:ActionWebService" }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#endpoint' do
|
14
|
-
subject { super().endpoint }
|
15
|
-
it { should == URI("http://example.com/api/api") }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#element_form_default' do
|
19
|
-
subject { super().element_form_default }
|
20
|
-
it { should == :unqualified }
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'has 3 operations' do
|
24
|
-
expect(subject.operations.size).to eq(3)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#operations' do
|
28
|
-
subject { super().operations }
|
29
|
-
it do
|
30
|
-
should include(
|
31
|
-
{ :get_user_login_by_id => { :input => "GetUserLoginById", :output => "GetUserLoginById", :action => "/api/api/GetUserLoginById", :namespace_identifier => "typens" } },
|
32
|
-
{ :get_all_contacts => { :input => "GetAllContacts", :output =>"GetAllContacts", :action => "/api/api/GetAllContacts", :namespace_identifier => "typens" } },
|
33
|
-
{ :search_user => { :input => "SearchUser", :output =>"SearchUser", :action => "/api/api/SearchUser", :namespace_identifier => nil } }
|
34
|
-
)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: savon295.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:savon295).read }
|
7
|
-
|
8
|
-
describe '#operations' do
|
9
|
-
subject { super().operations }
|
10
|
-
it do
|
11
|
-
should include(
|
12
|
-
{ :sendsms => { :input => "sendsms", :output => "sendsms", :action => "sendsms", :namespace_identifier => "tns" } }
|
13
|
-
)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: soap12.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:soap12).read }
|
7
|
-
|
8
|
-
describe '#endpoint' do
|
9
|
-
subject { super().endpoint }
|
10
|
-
it { should == URI("http://blogsite.example.com/endpoint12") }
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
context "with: two_bindings.wsdl" do
|
5
|
-
|
6
|
-
subject { Wasabi::Document.new fixture(:two_bindings).read }
|
7
|
-
|
8
|
-
describe '#element_form_default' do
|
9
|
-
subject { super().element_form_default }
|
10
|
-
it { should == :unqualified }
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'has 3 operations' do
|
14
|
-
expect(subject.operations.size).to eq(3)
|
15
|
-
end
|
16
|
-
|
17
|
-
describe '#operations' do
|
18
|
-
subject { super().operations }
|
19
|
-
it do
|
20
|
-
should include(
|
21
|
-
{ :post => { :input => "Post", :action => "Post" } },
|
22
|
-
{ :post11only => { :input => "Post11only", :action => "Post11only" } },
|
23
|
-
{ :post12only => { :input => "Post12only", :action => "Post12only" } }
|
24
|
-
)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Document do
|
4
|
-
|
5
|
-
subject { Wasabi::Document.new fixture(:authentication).read }
|
6
|
-
|
7
|
-
it "accepts a URL" do
|
8
|
-
expect(HTTPI).to receive(:get) { HTTPI::Response.new(200, {}, "wsdl") }
|
9
|
-
|
10
|
-
document = Wasabi::Document.new("http://example.com?wsdl")
|
11
|
-
expect(document.xml).to eq("wsdl")
|
12
|
-
end
|
13
|
-
|
14
|
-
it "accepts a path" do
|
15
|
-
document = Wasabi::Document.new fixture(:authentication).path
|
16
|
-
expect(document.xml).to eq(fixture(:authentication).read)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "accepts raw XML" do
|
20
|
-
document = Wasabi::Document.new fixture(:authentication).read
|
21
|
-
expect(document.xml).to eq(fixture(:authentication).read)
|
22
|
-
end
|
23
|
-
|
24
|
-
describe ".validate_element_form_default!" do
|
25
|
-
[:unqualified, :qualified].each do |value|
|
26
|
-
it "does not raise for :#{value}" do
|
27
|
-
expect { Wasabi::Document.validate_element_form_default!(value) }.to_not raise_error
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
it "raises if given an invalid value" do
|
32
|
-
error_msg = "Invalid value for elementFormDefault: invalid\n" +
|
33
|
-
"Must be one of: [:unqualified, :qualified]"
|
34
|
-
|
35
|
-
expect { Wasabi::Document.validate_element_form_default!(:invalid) }.
|
36
|
-
to raise_error(ArgumentError, error_msg)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#element_form_default" do
|
41
|
-
it "defaults to :unqualified" do
|
42
|
-
expect(subject.element_form_default).to eq(:unqualified)
|
43
|
-
end
|
44
|
-
|
45
|
-
[:unqualified, :qualified].each do |value|
|
46
|
-
it "accepts :#{value}" do
|
47
|
-
subject.element_form_default = value
|
48
|
-
expect(subject.element_form_default).to eq(value)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
it "raises if set to an invalid value" do
|
53
|
-
expect { subject.element_form_default = :invalid }.
|
54
|
-
to raise_error(ArgumentError, /Invalid value for elementFormDefault/)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Parser do
|
4
|
-
context "with: geotrust.wsdl" do
|
5
|
-
|
6
|
-
subject do
|
7
|
-
parser = Wasabi::Parser.new Nokogiri::XML(xml)
|
8
|
-
parser.parse
|
9
|
-
parser
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:xml) { fixture(:geotrust).read }
|
13
|
-
|
14
|
-
it "returns the #service_name attribute" do
|
15
|
-
expect(subject.service_name).to eq("queryDefinitions")
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Parser do
|
4
|
-
context "with: import_port_types.wsdl" do
|
5
|
-
|
6
|
-
subject do
|
7
|
-
parser = Wasabi::Parser.new Nokogiri::XML(xml)
|
8
|
-
parser.parse
|
9
|
-
parser
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:xml) { fixture(:import_port_types).read }
|
13
|
-
|
14
|
-
it "does blow up when portTypes are imported" do
|
15
|
-
get_customer = subject.operations[:get_customer]
|
16
|
-
|
17
|
-
expect(get_customer[:input]).to eq("GetCustomer")
|
18
|
-
expect(get_customer[:namespace_identifier]).to be_nil
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Wasabi::Parser do
|
4
|
-
context 'with: juniper.wsdl' do
|
5
|
-
|
6
|
-
subject do
|
7
|
-
parser = Wasabi::Parser.new Nokogiri::XML(xml)
|
8
|
-
parser.parse
|
9
|
-
parser
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:xml) { fixture(:juniper).read }
|
13
|
-
|
14
|
-
it 'does not blow up when an extension base element is defined in an import' do
|
15
|
-
request = subject.operations[:get_system_info_request]
|
16
|
-
|
17
|
-
expect(request[:input]).to eq('GetSystemInfoRequest')
|
18
|
-
expect(request[:action]).to eq('urn:#GetSystemInfoRequest')
|
19
|
-
expect(request[:namespace_identifier]).to eq('impl')
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Wasabi::Parser do
|
4
|
-
context 'with: marketo.wsdl' do
|
5
|
-
subject do
|
6
|
-
parser = Wasabi::Parser.new Nokogiri::XML(xml)
|
7
|
-
parser.parse
|
8
|
-
parser
|
9
|
-
end
|
10
|
-
|
11
|
-
let(:xml) { fixture(:marketo).read }
|
12
|
-
|
13
|
-
it 'parses the operations' do
|
14
|
-
expect(subject.operations[:get_lead][:input]).to eq('paramsGetLead')
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|