savon 2.13.0 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/README.md +2 -4
- data/lib/savon/builder.rb +7 -3
- data/lib/savon/model.rb +3 -3
- data/lib/savon/options.rb +1 -1
- data/lib/savon/response.rb +3 -3
- data/lib/savon/string_utils.rb +17 -0
- data/lib/savon/version.rb +1 -1
- data/lib/savon.rb +1 -0
- metadata +15 -103
- data/.gitignore +0 -16
- data/.yardopts +0 -6
- data/CONTRIBUTING.md +0 -42
- data/Gemfile +0 -8
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coverage/assets/0.12.3/application.css +0 -1
- data/coverage/assets/0.12.3/application.js +0 -7
- data/coverage/assets/0.12.3/colorbox/border.png +0 -0
- data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
- data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
- data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.12.3/favicon_green.png +0 -0
- data/coverage/assets/0.12.3/favicon_red.png +0 -0
- data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/assets/0.12.3/loading.gif +0 -0
- data/coverage/assets/0.12.3/magnify.png +0 -0
- data/coverage/index.html +0 -21518
- data/lib/savon/core_ext/string.rb +0 -30
- data/savon.gemspec +0 -47
- data/spec/fixtures/gzip/message.gz +0 -0
- data/spec/fixtures/response/another_soap_fault.xml +0 -14
- data/spec/fixtures/response/authentication.xml +0 -14
- data/spec/fixtures/response/empty_soap_fault.xml +0 -13
- data/spec/fixtures/response/f5.xml +0 -39
- data/spec/fixtures/response/header.xml +0 -13
- data/spec/fixtures/response/list.xml +0 -18
- data/spec/fixtures/response/multi_ref.xml +0 -39
- data/spec/fixtures/response/no_body.xml +0 -1
- data/spec/fixtures/response/soap_fault.xml +0 -8
- data/spec/fixtures/response/soap_fault12.xml +0 -18
- data/spec/fixtures/response/soap_fault_funky.xml +0 -8
- data/spec/fixtures/response/taxcloud.xml +0 -1
- data/spec/fixtures/ssl/client_cert.pem +0 -16
- data/spec/fixtures/ssl/client_encrypted_key.pem +0 -30
- data/spec/fixtures/ssl/client_encrypted_key_cert.pem +0 -24
- data/spec/fixtures/ssl/client_key.pem +0 -15
- data/spec/fixtures/wsdl/authentication.xml +0 -63
- data/spec/fixtures/wsdl/betfair.xml +0 -2981
- data/spec/fixtures/wsdl/brand.xml +0 -624
- data/spec/fixtures/wsdl/edialog.xml +0 -15416
- data/spec/fixtures/wsdl/elements_in_types.xml +0 -43
- data/spec/fixtures/wsdl/interhome.xml +0 -2137
- data/spec/fixtures/wsdl/lower_camel.xml +0 -52
- data/spec/fixtures/wsdl/multiple_namespaces.xml +0 -92
- data/spec/fixtures/wsdl/multiple_types.xml +0 -60
- data/spec/fixtures/wsdl/no_message_tag.xml +0 -1267
- data/spec/fixtures/wsdl/taxcloud.xml +0 -934
- data/spec/fixtures/wsdl/team_software.xml +0 -1
- data/spec/fixtures/wsdl/vies.xml +0 -176
- data/spec/fixtures/wsdl/wasmuth.xml +0 -153
- data/spec/integration/support/application.rb +0 -114
- data/spec/integration/support/server.rb +0 -85
- data/spec/integration/zipcode_example_spec.rb +0 -39
- data/spec/savon/builder_spec.rb +0 -138
- data/spec/savon/client_spec.rb +0 -272
- data/spec/savon/core_ext/string_spec.rb +0 -38
- data/spec/savon/features/message_tag_spec.rb +0 -62
- data/spec/savon/http_error_spec.rb +0 -57
- data/spec/savon/log_message_spec.rb +0 -51
- data/spec/savon/message_spec.rb +0 -61
- data/spec/savon/mock_spec.rb +0 -175
- data/spec/savon/model_spec.rb +0 -183
- data/spec/savon/multipart_request_spec.rb +0 -46
- data/spec/savon/observers_spec.rb +0 -93
- data/spec/savon/operation_spec.rb +0 -207
- data/spec/savon/options_spec.rb +0 -1154
- data/spec/savon/qualified_message_spec.rb +0 -102
- data/spec/savon/request_logger_spec.rb +0 -38
- data/spec/savon/request_spec.rb +0 -581
- data/spec/savon/response_spec.rb +0 -276
- data/spec/savon/soap_fault_spec.rb +0 -147
- data/spec/savon/softlayer_spec.rb +0 -28
- data/spec/spec_helper.rb +0 -31
- data/spec/support/adapters.rb +0 -49
- data/spec/support/endpoint.rb +0 -26
- data/spec/support/fixture.rb +0 -40
- data/spec/support/integration.rb +0 -10
- data/spec/support/stdout.rb +0 -26
@@ -1,102 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
module Savon
|
5
|
-
RSpec.describe QualifiedMessage, "#to_hash" do
|
6
|
-
|
7
|
-
context "if a key ends with !" do
|
8
|
-
let(:used_namespaces) { {} }
|
9
|
-
let(:key_converter) { :camelcase }
|
10
|
-
let(:types) { {} }
|
11
|
-
|
12
|
-
it "restores the ! in a key" do
|
13
|
-
message = described_class.new(types, used_namespaces, key_converter)
|
14
|
-
resulting_hash = message.to_hash({:Metal! => "<Nice/>"}, ["Rock"])
|
15
|
-
|
16
|
-
expect(resulting_hash).to eq({ :Metal! => "<Nice/>" })
|
17
|
-
end
|
18
|
-
|
19
|
-
it "properly handles special keys when namespaces are present" do
|
20
|
-
used_namespaces = {
|
21
|
-
%w(tns Foo) => 'ns',
|
22
|
-
%w(tns Foo Bar) => 'ns'
|
23
|
-
}
|
24
|
-
|
25
|
-
hash = {
|
26
|
-
:foo => {
|
27
|
-
:bar => {
|
28
|
-
:zing => 'pow'
|
29
|
-
},
|
30
|
-
:cash => {
|
31
|
-
:@attr1 => 'val1',
|
32
|
-
:content! => 'Chunky Bacon'
|
33
|
-
},
|
34
|
-
:attributes! => {
|
35
|
-
:bar => { :attr2 => 'val2' },
|
36
|
-
},
|
37
|
-
:"self_closing/" => '',
|
38
|
-
:order! => [:cash, :bar, :"self_closing/"]
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
good_result = {
|
43
|
-
"ns:Foo" => {
|
44
|
-
'ns:Bar' => { :zing => "pow" },
|
45
|
-
:cash => {
|
46
|
-
:@attr1 => "val1",
|
47
|
-
:content! => "Chunky Bacon"
|
48
|
-
},
|
49
|
-
:attributes! => {
|
50
|
-
'ns:Bar' => { :attr2 => 'val2' }
|
51
|
-
},
|
52
|
-
:"self_closing/" => '',
|
53
|
-
:order! => [:cash, 'ns:Bar', :"self_closing/"]
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
good_xml = %(<ns:Foo><Cash attr1="val1">Chunky Bacon</Cash><ns:Bar attr2="val2"><Zing>pow</Zing></ns:Bar><SelfClosing/></ns:Foo>)
|
58
|
-
|
59
|
-
message = described_class.new(types, used_namespaces, key_converter)
|
60
|
-
resulting_hash = message.to_hash(hash, ['tns'])
|
61
|
-
xml = Gyoku.xml(resulting_hash, key_converter: key_converter)
|
62
|
-
|
63
|
-
expect(resulting_hash).to eq good_result
|
64
|
-
expect(xml).to eq good_xml
|
65
|
-
end
|
66
|
-
|
67
|
-
it "properly handles boolean false" do
|
68
|
-
used_namespaces = {
|
69
|
-
%w(tns Foo) => 'ns'
|
70
|
-
}
|
71
|
-
|
72
|
-
hash = {
|
73
|
-
:foo => {
|
74
|
-
:falsey => {
|
75
|
-
:@attr1 => false,
|
76
|
-
:content! => false
|
77
|
-
}
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
good_result = {
|
82
|
-
"ns:Foo" => {
|
83
|
-
:falsey => {
|
84
|
-
:@attr1 => false,
|
85
|
-
:content! => false
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
good_xml = %(<ns:Foo><Falsey attr1="false">false</Falsey></ns:Foo>)
|
91
|
-
|
92
|
-
message = described_class.new(types, used_namespaces, key_converter)
|
93
|
-
resulting_hash = message.to_hash(hash, ['tns'])
|
94
|
-
xml = Gyoku.xml(resulting_hash, key_converter: key_converter)
|
95
|
-
|
96
|
-
expect(resulting_hash).to eq good_result
|
97
|
-
expect(xml).to eq good_xml
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
RSpec.describe Savon::RequestLogger do
|
5
|
-
|
6
|
-
subject { described_class.new(globals) }
|
7
|
-
let(:globals) { Savon::GlobalOptions.new(:log => true, :pretty_print_xml => true) }
|
8
|
-
let(:request) {
|
9
|
-
stub('Request',
|
10
|
-
:url => 'http://example.com',
|
11
|
-
:headers => [],
|
12
|
-
:body => '<TestRequest />'
|
13
|
-
)
|
14
|
-
}
|
15
|
-
|
16
|
-
let(:response) {
|
17
|
-
stub('Response',
|
18
|
-
:code => 200,
|
19
|
-
:body => '<TestResponse />'
|
20
|
-
)
|
21
|
-
}
|
22
|
-
|
23
|
-
before(:each) {
|
24
|
-
globals[:logger].level = Logger::DEBUG
|
25
|
-
}
|
26
|
-
|
27
|
-
describe '#log_request / #log_response' do
|
28
|
-
it 'does not prepare log messages when no logging is needed' do
|
29
|
-
begin
|
30
|
-
globals[:logger].level = Logger::FATAL
|
31
|
-
|
32
|
-
Savon::LogMessage.expects(:new).never
|
33
|
-
subject.log(request) { response }
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|