savon 2.13.1 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -1
  3. data/lib/savon/builder.rb +4 -3
  4. data/lib/savon/model.rb +3 -3
  5. data/lib/savon/options.rb +1 -1
  6. data/lib/savon/response.rb +3 -3
  7. data/lib/savon/string_utils.rb +17 -0
  8. data/lib/savon/version.rb +1 -1
  9. data/lib/savon.rb +1 -0
  10. metadata +35 -81
  11. data/.gitignore +0 -16
  12. data/.yardopts +0 -6
  13. data/CONTRIBUTING.md +0 -42
  14. data/Gemfile +0 -8
  15. data/RELEASING.md +0 -10
  16. data/lib/savon/core_ext/string.rb +0 -30
  17. data/savon.gemspec +0 -47
  18. data/spec/fixtures/gzip/message.gz +0 -0
  19. data/spec/fixtures/response/another_soap_fault.xml +0 -14
  20. data/spec/fixtures/response/authentication.xml +0 -14
  21. data/spec/fixtures/response/empty_soap_fault.xml +0 -13
  22. data/spec/fixtures/response/f5.xml +0 -39
  23. data/spec/fixtures/response/header.xml +0 -13
  24. data/spec/fixtures/response/list.xml +0 -18
  25. data/spec/fixtures/response/multi_ref.xml +0 -39
  26. data/spec/fixtures/response/no_body.xml +0 -1
  27. data/spec/fixtures/response/soap_fault.xml +0 -8
  28. data/spec/fixtures/response/soap_fault12.xml +0 -18
  29. data/spec/fixtures/response/soap_fault_funky.xml +0 -8
  30. data/spec/fixtures/response/taxcloud.xml +0 -1
  31. data/spec/fixtures/ssl/client_cert.pem +0 -16
  32. data/spec/fixtures/ssl/client_encrypted_key.pem +0 -30
  33. data/spec/fixtures/ssl/client_encrypted_key_cert.pem +0 -24
  34. data/spec/fixtures/ssl/client_key.pem +0 -15
  35. data/spec/fixtures/wsdl/authentication.xml +0 -63
  36. data/spec/fixtures/wsdl/betfair.xml +0 -2981
  37. data/spec/fixtures/wsdl/brand.xml +0 -624
  38. data/spec/fixtures/wsdl/edialog.xml +0 -15416
  39. data/spec/fixtures/wsdl/elements_in_types.xml +0 -43
  40. data/spec/fixtures/wsdl/interhome.xml +0 -2137
  41. data/spec/fixtures/wsdl/lower_camel.xml +0 -52
  42. data/spec/fixtures/wsdl/multiple_namespaces.xml +0 -92
  43. data/spec/fixtures/wsdl/multiple_types.xml +0 -60
  44. data/spec/fixtures/wsdl/no_message_tag.xml +0 -1267
  45. data/spec/fixtures/wsdl/taxcloud.xml +0 -934
  46. data/spec/fixtures/wsdl/team_software.xml +0 -1
  47. data/spec/fixtures/wsdl/vies.xml +0 -176
  48. data/spec/fixtures/wsdl/wasmuth.xml +0 -153
  49. data/spec/integration/support/application.rb +0 -114
  50. data/spec/integration/support/server.rb +0 -85
  51. data/spec/integration/zipcode_example_spec.rb +0 -39
  52. data/spec/savon/builder_spec.rb +0 -138
  53. data/spec/savon/client_spec.rb +0 -272
  54. data/spec/savon/core_ext/string_spec.rb +0 -38
  55. data/spec/savon/features/message_tag_spec.rb +0 -62
  56. data/spec/savon/http_error_spec.rb +0 -57
  57. data/spec/savon/log_message_spec.rb +0 -51
  58. data/spec/savon/message_spec.rb +0 -61
  59. data/spec/savon/mock_spec.rb +0 -175
  60. data/spec/savon/model_spec.rb +0 -183
  61. data/spec/savon/multipart_request_spec.rb +0 -46
  62. data/spec/savon/observers_spec.rb +0 -93
  63. data/spec/savon/operation_spec.rb +0 -207
  64. data/spec/savon/options_spec.rb +0 -1154
  65. data/spec/savon/qualified_message_spec.rb +0 -102
  66. data/spec/savon/request_logger_spec.rb +0 -38
  67. data/spec/savon/request_spec.rb +0 -581
  68. data/spec/savon/response_spec.rb +0 -276
  69. data/spec/savon/soap_fault_spec.rb +0 -147
  70. data/spec/savon/softlayer_spec.rb +0 -42
  71. data/spec/spec_helper.rb +0 -31
  72. data/spec/support/adapters.rb +0 -49
  73. data/spec/support/endpoint.rb +0 -26
  74. data/spec/support/fixture.rb +0 -40
  75. data/spec/support/integration.rb +0 -10
  76. 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