wasabi 3.3.0 → 3.3.1
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 +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/lib/wasabi/parser.rb +67 -18
- data/lib/wasabi/version.rb +1 -1
- data/spec/fixtures/savon562.wsdl +13882 -0
- data/spec/wasabi/core_ext/string_spec.rb +9 -9
- data/spec/wasabi/document/authentication_spec.rb +19 -5
- data/spec/wasabi/document/encoded_endpoint_spec.rb +4 -1
- data/spec/wasabi/document/geotrust_spec.rb +19 -5
- data/spec/wasabi/document/inherited_spec.rb +10 -7
- data/spec/wasabi/document/multiple_namespaces_spec.rb +27 -7
- data/spec/wasabi/document/namespaced_actions_spec.rb +19 -5
- data/spec/wasabi/document/no_namespace_spec.rb +19 -5
- data/spec/wasabi/document/savon295_spec.rb +4 -1
- data/spec/wasabi/document/soap12_spec.rb +4 -1
- data/spec/wasabi/document/two_bindings_spec.rb +11 -3
- data/spec/wasabi/document_spec.rb +6 -6
- data/spec/wasabi/parser/get_servicename_spec.rb +1 -1
- data/spec/wasabi/parser/import_port_types_spec.rb +2 -2
- data/spec/wasabi/parser/juniper_spec.rb +3 -3
- data/spec/wasabi/parser/marketo_spec.rb +1 -1
- data/spec/wasabi/parser/message_element_spec.rb +17 -0
- data/spec/wasabi/parser/multiple_namespaces_spec.rb +7 -7
- data/spec/wasabi/parser/multiple_parts_in_message_spec.rb +8 -4
- data/spec/wasabi/parser/no_message_parts_spec.rb +6 -6
- data/spec/wasabi/parser/no_namespace_spec.rb +4 -4
- data/spec/wasabi/parser/no_target_namespace_spec.rb +1 -1
- data/spec/wasabi/parser/symbolic_endpoint_spec.rb +2 -2
- data/spec/wasabi/parser/tradetracker_spec.rb +1 -1
- data/spec/wasabi/resolver_spec.rb +10 -10
- data/spec/wasabi/wasabi_spec.rb +1 -1
- data/wasabi.gemspec +1 -2
- metadata +22 -32
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Wasabi::Parser do
|
4
|
+
context 'with: savon562.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(:savon562).read }
|
12
|
+
|
13
|
+
it 'parses the operations' do
|
14
|
+
subject.operations[:write_case_eform_data][:input].should == 'writeCaseEformData'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -12,28 +12,28 @@ describe Wasabi::Parser do
|
|
12
12
|
let(:xml) { fixture(:multiple_namespaces).read }
|
13
13
|
|
14
14
|
it "lists the types" do
|
15
|
-
subject.types.keys.sort.
|
15
|
+
expect(subject.types.keys.sort).to eq(["Article", "Save"])
|
16
16
|
end
|
17
17
|
|
18
18
|
it "records the namespace for each type" do
|
19
|
-
subject.types["Save"][:namespace].
|
19
|
+
expect(subject.types["Save"][:namespace]).to eq("http://example.com/actions")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "records the fields under a type" do
|
23
|
-
subject.types["Save"].keys.
|
23
|
+
expect(subject.types["Save"].keys).to match_array(["article", :namespace, :order!])
|
24
24
|
end
|
25
25
|
|
26
26
|
it "records multiple fields when there are more than one" do
|
27
|
-
subject.types["Article"].keys.
|
27
|
+
expect(subject.types["Article"].keys).to match_array(["Title", "Author", :namespace, :order!])
|
28
28
|
end
|
29
29
|
|
30
30
|
it "records the type of a field" do
|
31
|
-
subject.types["Save"]["article"][:type].
|
32
|
-
subject.namespaces["article"].
|
31
|
+
expect(subject.types["Save"]["article"][:type]).to eq("article:Article")
|
32
|
+
expect(subject.namespaces["article"]).to eq("http://example.com/article")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "lists the order of the type elements" do
|
36
|
-
subject.types["Article"][:order!].
|
36
|
+
expect(subject.types["Article"][:order!]).to eq(["Author", "Title"])
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
@@ -13,19 +13,23 @@ describe Wasabi::Parser do
|
|
13
13
|
|
14
14
|
context "with a parts attribute in soap:body element" do
|
15
15
|
it 'uses the part specified in parts attribute' do
|
16
|
+
pending("need to determine if these tests are actually valid. QName resolution of operations is complex")
|
17
|
+
|
16
18
|
request = subject.operations[:some_operation][:input]
|
17
19
|
|
18
|
-
request.
|
20
|
+
expect(request).to eq("SomeRequestBody")
|
19
21
|
end
|
20
22
|
end
|
21
|
-
|
23
|
+
|
22
24
|
context "with no parts attribute in soap:body element" do
|
23
25
|
it 'uses the first part element in message' do
|
26
|
+
pending("need to determine if these tests are actually valid. QName resolution of operations is complex")
|
27
|
+
|
24
28
|
request = subject.operations[:other_operation][:input]
|
25
29
|
|
26
|
-
request.
|
30
|
+
expect(request).to eq("SomeRequest")
|
27
31
|
end
|
28
32
|
end
|
29
|
-
|
33
|
+
|
30
34
|
end
|
31
35
|
end
|
@@ -13,20 +13,20 @@ describe Wasabi::Parser do
|
|
13
13
|
|
14
14
|
it 'falls back to using the message type in the port element' do
|
15
15
|
# Operation's input has no part element in the message, so using the message type.
|
16
|
-
subject.operations[:save][:input].
|
16
|
+
expect(subject.operations[:save][:input]).to eq('Save')
|
17
17
|
|
18
18
|
# Operation's output has part element in the message, so using part element's type.
|
19
|
-
subject.operations[:save][:output].
|
19
|
+
expect(subject.operations[:save][:output]).to eq('SaveResponse')
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'falls back to using the namespace ID in the port element' do
|
23
|
-
subject.operations[:save][:namespace_identifier].
|
23
|
+
expect(subject.operations[:save][:namespace_identifier]).to eq('actions')
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'gracefully handles port messages without a colon' do
|
27
|
-
subject.operations[:delete][:input].
|
28
|
-
subject.operations[:delete][:output].
|
29
|
-
subject.operations[:delete][:namespace_identifier].
|
27
|
+
expect(subject.operations[:delete][:input]).to eq('Delete')
|
28
|
+
expect(subject.operations[:delete][:output]).to eq('DeleteResponse')
|
29
|
+
expect(subject.operations[:delete][:namespace_identifier]).to be_nil
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -12,15 +12,15 @@ describe Wasabi::Parser do
|
|
12
12
|
let(:xml) { fixture(:no_namespace).read }
|
13
13
|
|
14
14
|
it "lists the types" do
|
15
|
-
subject.types.keys.sort.
|
15
|
+
expect(subject.types.keys.sort).to eq(["McContact", "McContactArray", "MpUser", "MpUserArray"])
|
16
16
|
end
|
17
17
|
|
18
18
|
it "ignores xsd:all" do
|
19
19
|
keys = subject.types["MpUser"].keys
|
20
|
-
keys.size.
|
20
|
+
expect(keys.size).to eq(2)
|
21
21
|
|
22
|
-
keys.
|
23
|
-
keys.
|
22
|
+
expect(keys).to include(:namespace)
|
23
|
+
expect(keys).to include(:order!)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -29,7 +29,7 @@ describe Wasabi::Parser do
|
|
29
29
|
# but I suppose we should do something reasonable if they do.
|
30
30
|
|
31
31
|
it "defaults to the target namespace from xs:definitions" do
|
32
|
-
subject.types["Save"][:namespace].
|
32
|
+
expect(subject.types["Save"][:namespace]).to eq("http://def.example.com")
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -12,12 +12,12 @@ describe Wasabi::Parser do
|
|
12
12
|
let(:xml) { fixture(:symbolic_endpoint).read }
|
13
13
|
|
14
14
|
it "allows symbolic endpoints" do
|
15
|
-
subject.endpoint.
|
15
|
+
expect(subject.endpoint).to be_nil
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should position base class attributes before subclass attributes in :order! array" do
|
19
19
|
type = subject.types["ROPtsLiesListe"]
|
20
|
-
type[:order!].
|
20
|
+
expect(type[:order!]).to eq(["messages", "returncode", "listenteil"])
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
@@ -4,16 +4,16 @@ describe Wasabi::Resolver do
|
|
4
4
|
|
5
5
|
describe "#resolve" do
|
6
6
|
it "resolves remote documents" do
|
7
|
-
HTTPI.
|
7
|
+
expect(HTTPI).to receive(:get) { HTTPI::Response.new(200, {}, "wsdl") }
|
8
8
|
xml = Wasabi::Resolver.new("http://example.com?wsdl").resolve
|
9
|
-
xml.
|
9
|
+
expect(xml).to eq("wsdl")
|
10
10
|
end
|
11
11
|
|
12
12
|
it "resolves remote documents with custom adapter" do
|
13
13
|
prev_logging = HTTPI.instance_variable_get(:@log)
|
14
14
|
HTTPI.log = false # Don't pollute rspec output by request logging
|
15
15
|
xml = Wasabi::Resolver.new("http://example.com?wsdl", nil, :fake_adapter_for_test).resolve
|
16
|
-
xml.
|
16
|
+
expect(xml).to eq("wsdl_by_adapter")
|
17
17
|
expect(FakeAdapterForTest.class_variable_get(:@@requests).size).to eq(1)
|
18
18
|
expect(FakeAdapterForTest.class_variable_get(:@@requests).first.url).to eq(URI.parse("http://example.com?wsdl"))
|
19
19
|
expect(FakeAdapterForTest.class_variable_get(:@@methods)).to eq([:get])
|
@@ -22,12 +22,12 @@ describe Wasabi::Resolver do
|
|
22
22
|
|
23
23
|
it "resolves local documents" do
|
24
24
|
xml = Wasabi::Resolver.new(fixture(:authentication).path).resolve
|
25
|
-
xml.
|
25
|
+
expect(xml).to eq(fixture(:authentication).read)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "simply returns raw XML" do
|
29
29
|
xml = Wasabi::Resolver.new("<xml/>").resolve
|
30
|
-
xml.
|
30
|
+
expect(xml).to eq("<xml/>")
|
31
31
|
end
|
32
32
|
|
33
33
|
it "raises HTTPError when #load_from_remote gets a response error" do
|
@@ -38,12 +38,12 @@ describe Wasabi::Resolver do
|
|
38
38
|
body = "<html><head><title>404 Not Found</title></head><body>Oops!</body></html>"
|
39
39
|
failed_response = HTTPI::Response.new(code, headers, body)
|
40
40
|
HTTPI.stub(:get => failed_response)
|
41
|
-
|
41
|
+
expect do
|
42
42
|
Wasabi::Resolver.new("http://example.com?wsdl").resolve
|
43
|
-
end.
|
44
|
-
ex.
|
45
|
-
ex.message.
|
46
|
-
ex.response.
|
43
|
+
end.to raise_error { |ex|
|
44
|
+
expect(ex).to be_a(Wasabi::Resolver::HTTPError)
|
45
|
+
expect(ex.message).to eq("Error: #{code}")
|
46
|
+
expect(ex.response).to eq(failed_response)
|
47
47
|
}
|
48
48
|
end
|
49
49
|
end
|
data/spec/wasabi/wasabi_spec.rb
CHANGED
data/wasabi.gemspec
CHANGED
@@ -16,10 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.add_dependency "httpi", "~> 2.0"
|
18
18
|
s.add_dependency "nokogiri", ">= 1.4.0"
|
19
|
-
s.add_dependency "mime-types", "< 2.0.0"
|
20
19
|
|
21
20
|
s.add_development_dependency "rake", "~> 0.9"
|
22
|
-
s.add_development_dependency "rspec", "~> 2.
|
21
|
+
s.add_development_dependency "rspec", "~> 2.14"
|
23
22
|
|
24
23
|
s.files = `git ls-files`.split("\n")
|
25
24
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,85 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wasabi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.4.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: mime-types
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - <
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 2.0.0
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - <
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 2.0.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - ~>
|
45
|
+
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0.9'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - ~>
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0.9'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - ~>
|
59
|
+
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
61
|
+
version: '2.14'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - ~>
|
66
|
+
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
68
|
+
version: '2.14'
|
83
69
|
description: A simple WSDL parser
|
84
70
|
email:
|
85
71
|
- me@rubiii.com
|
@@ -87,9 +73,9 @@ executables: []
|
|
87
73
|
extensions: []
|
88
74
|
extra_rdoc_files: []
|
89
75
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .rspec
|
92
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
93
79
|
- CHANGELOG.md
|
94
80
|
- Gemfile
|
95
81
|
- LICENSE
|
@@ -117,6 +103,7 @@ files:
|
|
117
103
|
- spec/fixtures/no_message_parts.wsdl
|
118
104
|
- spec/fixtures/no_namespace.wsdl
|
119
105
|
- spec/fixtures/savon295.wsdl
|
106
|
+
- spec/fixtures/savon562.wsdl
|
120
107
|
- spec/fixtures/soap12.wsdl
|
121
108
|
- spec/fixtures/symbolic_endpoint.wsdl
|
122
109
|
- spec/fixtures/tradetracker.wsdl
|
@@ -142,6 +129,7 @@ files:
|
|
142
129
|
- spec/wasabi/parser/import_port_types_spec.rb
|
143
130
|
- spec/wasabi/parser/juniper_spec.rb
|
144
131
|
- spec/wasabi/parser/marketo_spec.rb
|
132
|
+
- spec/wasabi/parser/message_element_spec.rb
|
145
133
|
- spec/wasabi/parser/multiple_namespaces_spec.rb
|
146
134
|
- spec/wasabi/parser/multiple_parts_in_message_spec.rb
|
147
135
|
- spec/wasabi/parser/no_message_parts_spec.rb
|
@@ -162,17 +150,17 @@ require_paths:
|
|
162
150
|
- lib
|
163
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
164
152
|
requirements:
|
165
|
-
- -
|
153
|
+
- - ">="
|
166
154
|
- !ruby/object:Gem::Version
|
167
155
|
version: '0'
|
168
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
157
|
requirements:
|
170
|
-
- -
|
158
|
+
- - ">="
|
171
159
|
- !ruby/object:Gem::Version
|
172
160
|
version: '0'
|
173
161
|
requirements: []
|
174
162
|
rubyforge_project: wasabi
|
175
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.2.2
|
176
164
|
signing_key:
|
177
165
|
specification_version: 4
|
178
166
|
summary: A simple WSDL parser
|
@@ -193,6 +181,7 @@ test_files:
|
|
193
181
|
- spec/fixtures/no_message_parts.wsdl
|
194
182
|
- spec/fixtures/no_namespace.wsdl
|
195
183
|
- spec/fixtures/savon295.wsdl
|
184
|
+
- spec/fixtures/savon562.wsdl
|
196
185
|
- spec/fixtures/soap12.wsdl
|
197
186
|
- spec/fixtures/symbolic_endpoint.wsdl
|
198
187
|
- spec/fixtures/tradetracker.wsdl
|
@@ -218,6 +207,7 @@ test_files:
|
|
218
207
|
- spec/wasabi/parser/import_port_types_spec.rb
|
219
208
|
- spec/wasabi/parser/juniper_spec.rb
|
220
209
|
- spec/wasabi/parser/marketo_spec.rb
|
210
|
+
- spec/wasabi/parser/message_element_spec.rb
|
221
211
|
- spec/wasabi/parser/multiple_namespaces_spec.rb
|
222
212
|
- spec/wasabi/parser/multiple_parts_in_message_spec.rb
|
223
213
|
- spec/wasabi/parser/no_message_parts_spec.rb
|