savon 2.11.1 → 2.15.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.
Files changed (92) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +132 -73
  3. data/README.md +35 -20
  4. data/lib/savon/block_interface.rb +1 -0
  5. data/lib/savon/builder.rb +126 -30
  6. data/lib/savon/client.rb +2 -2
  7. data/lib/savon/header.rb +2 -6
  8. data/lib/savon/http_error.rb +4 -4
  9. data/lib/savon/log_message.rb +2 -1
  10. data/lib/savon/message.rb +1 -0
  11. data/lib/savon/mock/expectation.rb +1 -0
  12. data/lib/savon/mock/spec_helper.rb +1 -0
  13. data/lib/savon/mock.rb +1 -0
  14. data/lib/savon/model.rb +4 -3
  15. data/lib/savon/operation.rb +22 -19
  16. data/lib/savon/options.rb +98 -19
  17. data/lib/savon/qualified_message.rb +29 -27
  18. data/lib/savon/request.rb +22 -6
  19. data/lib/savon/request_logger.rb +8 -2
  20. data/lib/savon/response.rb +58 -10
  21. data/lib/savon/soap_fault.rb +3 -4
  22. data/lib/savon/string_utils.rb +17 -0
  23. data/lib/savon/version.rb +2 -1
  24. data/lib/savon.rb +2 -0
  25. metadata +80 -100
  26. data/.gitignore +0 -14
  27. data/.travis.yml +0 -15
  28. data/.yardopts +0 -6
  29. data/CONTRIBUTING.md +0 -46
  30. data/Gemfile +0 -18
  31. data/donate.png +0 -0
  32. data/lib/savon/core_ext/string.rb +0 -29
  33. data/savon.gemspec +0 -46
  34. data/spec/fixtures/gzip/message.gz +0 -0
  35. data/spec/fixtures/response/another_soap_fault.xml +0 -14
  36. data/spec/fixtures/response/authentication.xml +0 -14
  37. data/spec/fixtures/response/f5.xml +0 -39
  38. data/spec/fixtures/response/header.xml +0 -13
  39. data/spec/fixtures/response/list.xml +0 -18
  40. data/spec/fixtures/response/multi_ref.xml +0 -39
  41. data/spec/fixtures/response/soap_fault.xml +0 -8
  42. data/spec/fixtures/response/soap_fault12.xml +0 -18
  43. data/spec/fixtures/response/soap_fault_funky.xml +0 -8
  44. data/spec/fixtures/response/taxcloud.xml +0 -1
  45. data/spec/fixtures/ssl/client_cert.pem +0 -16
  46. data/spec/fixtures/ssl/client_encrypted_key.pem +0 -30
  47. data/spec/fixtures/ssl/client_encrypted_key_cert.pem +0 -24
  48. data/spec/fixtures/ssl/client_key.pem +0 -15
  49. data/spec/fixtures/wsdl/authentication.xml +0 -63
  50. data/spec/fixtures/wsdl/betfair.xml +0 -2981
  51. data/spec/fixtures/wsdl/edialog.xml +0 -15416
  52. data/spec/fixtures/wsdl/interhome.xml +0 -2137
  53. data/spec/fixtures/wsdl/lower_camel.xml +0 -52
  54. data/spec/fixtures/wsdl/multiple_namespaces.xml +0 -92
  55. data/spec/fixtures/wsdl/multiple_types.xml +0 -60
  56. data/spec/fixtures/wsdl/no_message_tag.xml +0 -1267
  57. data/spec/fixtures/wsdl/taxcloud.xml +0 -934
  58. data/spec/fixtures/wsdl/team_software.xml +0 -1
  59. data/spec/fixtures/wsdl/vies.xml +0 -176
  60. data/spec/fixtures/wsdl/wasmuth.xml +0 -153
  61. data/spec/integration/centra_spec.rb +0 -66
  62. data/spec/integration/email_example_spec.rb +0 -32
  63. data/spec/integration/random_quote_spec.rb +0 -23
  64. data/spec/integration/ratp_example_spec.rb +0 -28
  65. data/spec/integration/stockquote_example_spec.rb +0 -28
  66. data/spec/integration/support/application.rb +0 -82
  67. data/spec/integration/support/server.rb +0 -84
  68. data/spec/integration/temperature_example_spec.rb +0 -46
  69. data/spec/integration/zipcode_example_spec.rb +0 -42
  70. data/spec/savon/builder_spec.rb +0 -137
  71. data/spec/savon/client_spec.rb +0 -271
  72. data/spec/savon/core_ext/string_spec.rb +0 -37
  73. data/spec/savon/features/message_tag_spec.rb +0 -61
  74. data/spec/savon/http_error_spec.rb +0 -49
  75. data/spec/savon/log_message_spec.rb +0 -44
  76. data/spec/savon/message_spec.rb +0 -70
  77. data/spec/savon/mock_spec.rb +0 -174
  78. data/spec/savon/model_spec.rb +0 -182
  79. data/spec/savon/observers_spec.rb +0 -92
  80. data/spec/savon/operation_spec.rb +0 -230
  81. data/spec/savon/options_spec.rb +0 -1064
  82. data/spec/savon/qualified_message_spec.rb +0 -20
  83. data/spec/savon/request_logger_spec.rb +0 -37
  84. data/spec/savon/request_spec.rb +0 -496
  85. data/spec/savon/response_spec.rb +0 -270
  86. data/spec/savon/soap_fault_spec.rb +0 -131
  87. data/spec/spec_helper.rb +0 -30
  88. data/spec/support/adapters.rb +0 -48
  89. data/spec/support/endpoint.rb +0 -25
  90. data/spec/support/fixture.rb +0 -39
  91. data/spec/support/integration.rb +0 -9
  92. data/spec/support/stdout.rb +0 -25
@@ -1,270 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Savon::Response do
4
-
5
- let(:globals) { Savon::GlobalOptions.new }
6
- let(:locals) { Savon::LocalOptions.new }
7
-
8
- describe ".new" do
9
- it "should raise a Savon::Fault in case of a SOAP fault" do
10
- expect { soap_fault_response }.to raise_error(Savon::SOAPFault)
11
- end
12
-
13
- it "should not raise a Savon::Fault in case the default is turned off" do
14
- globals[:raise_errors] = false
15
- expect { soap_fault_response }.not_to raise_error
16
- end
17
-
18
- it "should raise a Savon::HTTP::Error in case of an HTTP error" do
19
- expect { soap_response :code => 500 }.to raise_error(Savon::HTTPError)
20
- end
21
-
22
- it "should not raise a Savon::HTTP::Error in case the default is turned off" do
23
- globals[:raise_errors] = false
24
- soap_response :code => 500
25
- end
26
- end
27
-
28
- describe "#success?" do
29
- before { globals[:raise_errors] = false }
30
-
31
- it "should return true if the request was successful" do
32
- expect(soap_response).to be_a_success
33
- end
34
-
35
- it "should return false if there was a SOAP fault" do
36
- expect(soap_fault_response).not_to be_a_success
37
- end
38
-
39
- it "should return false if there was an HTTP error" do
40
- expect(http_error_response).not_to be_a_success
41
- end
42
- end
43
-
44
- describe "#soap_fault?" do
45
- before { globals[:raise_errors] = false }
46
-
47
- it "should not return true in case the response seems to be ok" do
48
- expect(soap_response.soap_fault?).to be_falsey
49
- end
50
-
51
- it "should return true in case of a SOAP fault" do
52
- expect(soap_fault_response.soap_fault?).to be_truthy
53
- end
54
- end
55
-
56
- describe "#soap_fault" do
57
- before { globals[:raise_errors] = false }
58
-
59
- it "should return nil in case the response seems to be ok" do
60
- expect(soap_response.soap_fault).to be_nil
61
- end
62
-
63
- it "should return a SOAPFault in case of a SOAP fault" do
64
- expect(soap_fault_response.soap_fault).to be_a(Savon::SOAPFault)
65
- end
66
- end
67
-
68
- describe "#http_error?" do
69
- before { globals[:raise_errors] = false }
70
-
71
- it "should not return true in case the response seems to be ok" do
72
- expect(soap_response.http_error?).not_to be_truthy
73
- end
74
-
75
- it "should return true in case of an HTTP error" do
76
- expect(soap_response(:code => 500).http_error?).to be_truthy
77
- end
78
- end
79
-
80
- describe "#http_error" do
81
- before { globals[:raise_errors] = false }
82
-
83
- it "should return nil in case the response seems to be ok" do
84
- expect(soap_response.http_error).to be_nil
85
- end
86
-
87
- it "should return a HTTPError in case of an HTTP error" do
88
- expect(soap_response(:code => 500).http_error).to be_a(Savon::HTTPError)
89
- end
90
- end
91
-
92
- describe "#header" do
93
- it "should return the SOAP response header as a Hash" do
94
- response = soap_response :body => Fixture.response(:header)
95
- expect(response.header).to include(:session_number => "ABCD1234")
96
- end
97
-
98
- it 'respects the global :strip_namespaces option' do
99
- globals[:strip_namespaces] = false
100
-
101
- response_with_header = soap_response(:body => Fixture.response(:header))
102
- header = response_with_header.header
103
-
104
- expect(header).to be_a(Hash)
105
-
106
- # notice: :session_number is a snake_case Symbol without namespaces,
107
- # but the Envelope and Header elements are qualified.
108
- expect(header.keys).to include(:session_number)
109
- end
110
-
111
- it 'respects the global :convert_response_tags_to option' do
112
- globals[:convert_response_tags_to] = lambda { |key| key.upcase }
113
-
114
- response_with_header = soap_response(:body => Fixture.response(:header))
115
- header = response_with_header.header
116
-
117
- expect(header).to be_a(Hash)
118
- expect(header.keys).to include('SESSIONNUMBER')
119
- end
120
-
121
- it 'respects the global :convert_attributes_to option' do
122
- globals[:convert_attributes_to] = lambda { |k,v| [] }
123
-
124
- response_with_header = soap_response(:body => Fixture.response(:header))
125
- header = response_with_header.header
126
-
127
- expect(header).to be_a(Hash)
128
- expect(header.keys).to include(:session_number)
129
- end
130
-
131
- it "should throw an exception when the response header isn't parsable" do
132
- expect { invalid_soap_response.header }.to raise_error Savon::InvalidResponseError
133
- end
134
- end
135
-
136
- %w(body to_hash).each do |method|
137
- describe "##{method}" do
138
- it "should return the SOAP response body as a Hash" do
139
- expect(soap_response.send(method)[:authenticate_response][:return]).to eq(
140
- Fixture.response_hash(:authentication)[:authenticate_response][:return]
141
- )
142
- end
143
-
144
- it "should return a Hash for a SOAP multiRef response" do
145
- hash = soap_response(:body => Fixture.response(:multi_ref)).send(method)
146
-
147
- expect(hash[:list_response]).to be_a(Hash)
148
- expect(hash[:multi_ref]).to be_an(Array)
149
- end
150
-
151
- it "should add existing namespaced elements as an array" do
152
- hash = soap_response(:body => Fixture.response(:list)).send(method)
153
-
154
- expect(hash[:multi_namespaced_entry_response][:history]).to be_a(Hash)
155
- expect(hash[:multi_namespaced_entry_response][:history][:case]).to be_an(Array)
156
- end
157
-
158
- it 'respects the global :strip_namespaces option' do
159
- globals[:strip_namespaces] = false
160
-
161
- body = soap_response.body
162
-
163
- expect(body).to be_a(Hash)
164
- expect(body.keys).to include(:"ns2:authenticate_response")
165
- end
166
-
167
- it 'respects the global :convert_response_tags_to option' do
168
- globals[:convert_response_tags_to] = lambda { |key| key.upcase }
169
-
170
- body = soap_response.body
171
-
172
- expect(body).to be_a(Hash)
173
- expect(body.keys).to include('AUTHENTICATERESPONSE')
174
- end
175
- end
176
- end
177
-
178
- describe "#to_array" do
179
- context "when the given path exists" do
180
- it "should return an Array containing the path value" do
181
- expect(soap_response.to_array(:authenticate_response, :return)).to eq(
182
- [Fixture.response_hash(:authentication)[:authenticate_response][:return]]
183
- )
184
- end
185
-
186
- it "should properly return FalseClass values [#327]" do
187
- body = Gyoku.xml(:envelope => { :body => { :return => { :success => false } } })
188
- expect(soap_response(:body => body).to_array(:return, :success)).to eq([false])
189
- end
190
- end
191
-
192
- context "when the given path returns nil" do
193
- it "should return an empty Array" do
194
- expect(soap_response.to_array(:authenticate_response, :undefined)).to eq([])
195
- end
196
- end
197
-
198
- context "when the given path does not exist at all" do
199
- it "should return an empty Array" do
200
- expect(soap_response.to_array(:authenticate_response, :some, :undefined, :path)).to eq([])
201
- end
202
- end
203
- end
204
-
205
- describe "#hash" do
206
- it "should return the complete SOAP response XML as a Hash" do
207
- response = soap_response :body => Fixture.response(:header)
208
- expect(response.hash[:envelope][:header][:session_number]).to eq("ABCD1234")
209
- end
210
- end
211
-
212
- describe "#to_xml" do
213
- it "should return the raw SOAP response body" do
214
- expect(soap_response.to_xml).to eq(Fixture.response(:authentication))
215
- end
216
- end
217
-
218
- describe "#doc" do
219
- it "returns a Nokogiri::XML::Document for the SOAP response XML" do
220
- expect(soap_response.doc).to be_a(Nokogiri::XML::Document)
221
- end
222
- end
223
-
224
- describe "#xpath" do
225
- it "permits XPath access to elements in the request" do
226
- expect(soap_response.xpath("//client").first.inner_text).to eq("radclient")
227
- expect(soap_response.xpath("//ns2:authenticateResponse/return/success").first.inner_text).to eq("true")
228
- end
229
- end
230
-
231
- describe '#find' do
232
- it 'delegates to Nori#find to find child elements inside the Envelope' do
233
- result = soap_response.find('Body', 'authenticateResponse', 'return')
234
-
235
- expect(result).to be_a(Hash)
236
- expect(result.keys).to include(:authentication_value)
237
- end
238
- end
239
-
240
- describe "#http" do
241
- it "should return the HTTPI::Response" do
242
- expect(soap_response.http).to be_an(HTTPI::Response)
243
- end
244
- end
245
-
246
- def soap_response(options = {})
247
- defaults = { :code => 200, :headers => {}, :body => Fixture.response(:authentication) }
248
- response = defaults.merge options
249
- http_response = HTTPI::Response.new(response[:code], response[:headers], response[:body])
250
-
251
- Savon::Response.new(http_response, globals, locals)
252
- end
253
-
254
- def soap_fault_response
255
- soap_response :code => 500, :body => Fixture.response(:soap_fault)
256
- end
257
-
258
- def http_error_response
259
- soap_response :code => 404, :body => "Not found"
260
- end
261
-
262
- def invalid_soap_response(options = {})
263
- defaults = { :code => 200, :headers => {}, :body => "I'm not SOAP" }
264
- response = defaults.merge options
265
- http_response = HTTPI::Response.new(response[:code], response[:headers], response[:body])
266
-
267
- Savon::Response.new(http_response, globals, locals)
268
- end
269
-
270
- end
@@ -1,131 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Savon::SOAPFault do
4
- let(:soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori }
5
- let(:soap_fault2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori }
6
- let(:soap_fault_funky) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault_funky)), nori }
7
- let(:soap_fault_nc) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori_no_convert }
8
- let(:soap_fault_nc2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori_no_convert }
9
- let(:another_soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:another_soap_fault)), nori }
10
- let(:no_fault) { Savon::SOAPFault.new new_response, nori }
11
-
12
- let(:nori) { Nori.new(:strip_namespaces => true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym }) }
13
- let(:nori_no_convert) { Nori.new(:strip_namespaces => true, :convert_tags_to => nil) }
14
-
15
- it "inherits from Savon::Error" do
16
- expect(Savon::SOAPFault.ancestors).to include(Savon::Error)
17
- end
18
-
19
- describe "#http" do
20
- it "returns the HTTPI::Response" do
21
- expect(soap_fault.http).to be_an(HTTPI::Response)
22
- end
23
- end
24
-
25
- describe ".present?" do
26
- it "returns true if the HTTP response contains a SOAP 1.1 fault" do
27
- http = new_response(:body => Fixture.response(:soap_fault))
28
- expect(Savon::SOAPFault.present? http).to be_truthy
29
- end
30
-
31
- it "returns true if the HTTP response contains a SOAP 1.2 fault" do
32
- http = new_response(:body => Fixture.response(:soap_fault12))
33
- expect(Savon::SOAPFault.present? http).to be_truthy
34
- end
35
-
36
- it "returns true if the HTTP response contains a SOAP fault with different namespaces" do
37
- http = new_response(:body => Fixture.response(:another_soap_fault))
38
- expect(Savon::SOAPFault.present? http).to be_truthy
39
- end
40
-
41
- it "returns false unless the HTTP response contains a SOAP fault" do
42
- expect(Savon::SOAPFault.present? new_response).to be_falsey
43
- end
44
- end
45
-
46
- [:message, :to_s].each do |method|
47
- describe "##{method}" do
48
- it "returns a SOAP 1.1 fault message" do
49
- expect(soap_fault.send method).to eq("(soap:Server) Fault occurred while processing.")
50
- end
51
-
52
- it "returns a SOAP 1.2 fault message" do
53
- expect(soap_fault2.send method).to eq("(soap:Sender) Sender Timeout")
54
- end
55
-
56
- it "returns a SOAP fault message (with different namespaces)" do
57
- expect(another_soap_fault.send method).to eq("(ERR_NO_SESSION) Wrong session message")
58
- end
59
-
60
- it "works even if the keys are different in a SOAP 1.1 fault message" do
61
- expect(soap_fault_nc.send method).to eq("(soap:Server) Fault occurred while processing.")
62
- end
63
-
64
- it "works even if the keys are different in a SOAP 1.2 fault message" do
65
- expect(soap_fault_nc2.send method).to eq("(soap:Sender) Sender Timeout")
66
- end
67
-
68
- it "works even if the keys are different in a funky SOAP fault message" do
69
- expect(soap_fault_funky.send method).to eq("(42) The Answer to Life The Universe And Everything")
70
- end
71
- end
72
- end
73
-
74
- describe "#to_hash" do
75
- it "returns the SOAP response as a Hash unless a SOAP fault is present" do
76
- expect(no_fault.to_hash[:authenticate_response][:return][:success]).to be_truthy
77
- end
78
-
79
- it "returns a SOAP 1.1 fault as a Hash" do
80
- expected = {
81
- :fault => {
82
- :faultstring => "Fault occurred while processing.",
83
- :faultcode => "soap:Server"
84
- }
85
- }
86
-
87
- expect(soap_fault.to_hash).to eq(expected)
88
- end
89
-
90
- it "returns a SOAP 1.2 fault as a Hash" do
91
- expected = {
92
- :fault => {
93
- :detail => { :max_time => "P5M" },
94
- :reason => { :text => "Sender Timeout" },
95
- :code => { :value => "soap:Sender", :subcode => { :value => "m:MessageTimeout" } }
96
- }
97
- }
98
-
99
- expect(soap_fault2.to_hash).to eq(expected)
100
- end
101
-
102
- it "works even if the keys are different" do
103
- expected = {
104
- "Fault" => {
105
- "Code" => {
106
- "Value" => "soap:Sender",
107
- "Subcode"=> {
108
- "Value" => "m:MessageTimeout"
109
- }
110
- },
111
- "Reason" => {
112
- "Text" => "Sender Timeout"
113
- },
114
- "Detail" => {
115
- "MaxTime" => "P5M"
116
- }
117
- }
118
- }
119
-
120
- expect(soap_fault_nc2.to_hash).to eq(expected)
121
- end
122
- end
123
-
124
- def new_response(options = {})
125
- defaults = { :code => 500, :headers => {}, :body => Fixture.response(:authentication) }
126
- response = defaults.merge options
127
-
128
- HTTPI::Response.new response[:code], response[:headers], response[:body]
129
- end
130
-
131
- end
data/spec/spec_helper.rb DELETED
@@ -1,30 +0,0 @@
1
- require "bundler"
2
- Bundler.setup(: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
- require "savon"
15
- require "rspec"
16
-
17
- # don't have HTTPI lazy-load HTTPClient, because then
18
- # it can't actually be refered to inside the specs.
19
- require "httpclient"
20
-
21
- support_files = File.expand_path("spec/support/**/*.rb")
22
- Dir[support_files].each { |file| require file }
23
-
24
- RSpec.configure do |config|
25
- config.include SpecSupport
26
- config.mock_with :mocha
27
- config.order = "random"
28
- end
29
-
30
- HTTPI.log = false
@@ -1,48 +0,0 @@
1
- require 'httpi/adapter/httpclient'
2
-
3
- # Proxy adapter. Records all requests and passes them to HTTPClient
4
- class AdapterForTest < HTTPI::Adapter::Base
5
-
6
- register :adapter_for_test
7
-
8
- def initialize(request)
9
- @@requests ||= []
10
- @@requests.push request
11
- @request = request
12
- @worker = HTTPI::Adapter::HTTPClient.new(request)
13
- end
14
-
15
- def client
16
- @worker.client
17
- end
18
-
19
- def request(method)
20
- @@methods ||= []
21
- @@methods.push method
22
- @worker.request(method)
23
- end
24
-
25
- end
26
-
27
- # Fake adapter with request recording.
28
- # Takes path from url and returns fixture WSDL with that name.
29
- class FakeAdapterForTest < HTTPI::Adapter::Base
30
-
31
- register :fake_adapter_for_test
32
-
33
- def initialize(request)
34
- @@requests ||= []
35
- @@requests.push request
36
- @request = request
37
- end
38
-
39
- attr_reader :client
40
-
41
- def request(method)
42
- @@methods ||= []
43
- @@methods.push method
44
- target = @request.url.path.to_sym
45
- HTTPI::Response.new(200, {}, Fixture.wsdl(target))
46
- end
47
-
48
- end
@@ -1,25 +0,0 @@
1
- class Endpoint
2
- class << self
3
-
4
- # Returns the WSDL endpoint for a given +type+ of request.
5
- def wsdl(type = nil)
6
- case type
7
- when :no_namespace then "http://nons.example.com/Service?wsdl"
8
- when :namespaced_actions then "http://nsactions.example.com/Service?wsdl"
9
- when :geotrust then "https://test-api.geotrust.com/webtrust/query.jws?WSDL"
10
- else soap(type)
11
- end
12
- end
13
-
14
- # Returns the SOAP endpoint for a given +type+ of request.
15
- def soap(type = nil)
16
- case type
17
- when :soap_fault then "http://soapfault.example.com/Service?wsdl"
18
- when :http_error then "http://httperror.example.com/Service?wsdl"
19
- when :invalid then "http://invalid.example.com/Service?wsdl"
20
- else "http://example.com/validation/1.0/AuthenticationService"
21
- end
22
- end
23
-
24
- end
25
- end
@@ -1,39 +0,0 @@
1
- class Fixture
2
-
3
- TYPES = { :gzip => "gz", :response => "xml", :wsdl => "xml" }
4
-
5
- class << self
6
-
7
- def [](type, fixture)
8
- fixtures(type)[fixture] ||= read_file type, fixture
9
- end
10
-
11
- def response_hash(fixture)
12
- @response_hash ||= {}
13
- @response_hash[fixture] ||= nori.parse(response(fixture))[:envelope][:body]
14
- end
15
-
16
- TYPES.each do |type, ext|
17
- define_method(type) { |fixture| self[type, fixture] }
18
- end
19
-
20
- private
21
-
22
- def nori
23
- Nori.new(:strip_namespaces => true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym })
24
- end
25
-
26
- def fixtures(type)
27
- @fixtures ||= {}
28
- @fixtures[type] ||= {}
29
- end
30
-
31
- def read_file(type, fixture)
32
- path = File.expand_path "../../fixtures/#{type}/#{fixture}.#{TYPES[type]}", __FILE__
33
- raise ArgumentError, "Unable to load: #{path}" unless File.exist? path
34
-
35
- File.read path
36
- end
37
-
38
- end
39
- end
@@ -1,9 +0,0 @@
1
- module SpecSupport
2
-
3
- def call_and_fail_gracefully(client, *args, &block)
4
- client.call(*args, &block)
5
- rescue Savon::SOAPFault => e
6
- pending e.message
7
- end
8
-
9
- end
@@ -1,25 +0,0 @@
1
- module SpecSupport
2
-
3
- def mock_stdout
4
- original_stdout = $stdout
5
-
6
- stdout = StringIO.new
7
- $stdout = stdout
8
-
9
- yield
10
-
11
- $stdout = original_stdout
12
- stdout
13
- end
14
-
15
- def silence_stdout
16
- original_stdout = $stdout
17
- $stdout = StringIO.new
18
-
19
- result = yield
20
-
21
- $stdout = original_stdout
22
- result
23
- end
24
-
25
- end