savon 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/CHANGELOG.md +119 -104
  2. data/README.md +12 -11
  3. data/Rakefile +0 -6
  4. data/lib/savon.rb +16 -14
  5. data/lib/savon/block_interface.rb +26 -0
  6. data/lib/savon/builder.rb +142 -0
  7. data/lib/savon/client.rb +36 -135
  8. data/lib/savon/header.rb +42 -0
  9. data/lib/savon/http_error.rb +27 -0
  10. data/lib/savon/log_message.rb +23 -25
  11. data/lib/savon/message.rb +35 -0
  12. data/lib/savon/mock.rb +5 -0
  13. data/lib/savon/mock/expectation.rb +70 -0
  14. data/lib/savon/mock/spec_helper.rb +62 -0
  15. data/lib/savon/model.rb +39 -61
  16. data/lib/savon/operation.rb +62 -0
  17. data/lib/savon/options.rb +265 -0
  18. data/lib/savon/qualified_message.rb +49 -0
  19. data/lib/savon/request.rb +92 -0
  20. data/lib/savon/response.rb +97 -0
  21. data/lib/savon/soap_fault.rb +40 -0
  22. data/lib/savon/version.rb +1 -1
  23. data/savon.gemspec +10 -8
  24. data/spec/integration/options_spec.rb +536 -0
  25. data/spec/integration/request_spec.rb +31 -16
  26. data/spec/integration/support/application.rb +80 -0
  27. data/spec/integration/support/server.rb +84 -0
  28. data/spec/savon/builder_spec.rb +81 -0
  29. data/spec/savon/client_spec.rb +90 -488
  30. data/spec/savon/http_error_spec.rb +49 -0
  31. data/spec/savon/log_message_spec.rb +33 -0
  32. data/spec/savon/mock_spec.rb +127 -0
  33. data/spec/savon/model_spec.rb +110 -99
  34. data/spec/savon/observers_spec.rb +92 -0
  35. data/spec/savon/operation_spec.rb +49 -0
  36. data/spec/savon/request_spec.rb +145 -0
  37. data/spec/savon/{soap/response_spec.rb → response_spec.rb} +22 -59
  38. data/spec/savon/soap_fault_spec.rb +94 -0
  39. data/spec/spec_helper.rb +5 -3
  40. data/spec/support/fixture.rb +5 -1
  41. metadata +202 -197
  42. data/lib/savon/config.rb +0 -46
  43. data/lib/savon/error.rb +0 -6
  44. data/lib/savon/hooks/group.rb +0 -68
  45. data/lib/savon/hooks/hook.rb +0 -61
  46. data/lib/savon/http/error.rb +0 -42
  47. data/lib/savon/logger.rb +0 -39
  48. data/lib/savon/null_logger.rb +0 -10
  49. data/lib/savon/soap.rb +0 -21
  50. data/lib/savon/soap/fault.rb +0 -59
  51. data/lib/savon/soap/invalid_response_error.rb +0 -13
  52. data/lib/savon/soap/request.rb +0 -86
  53. data/lib/savon/soap/request_builder.rb +0 -205
  54. data/lib/savon/soap/response.rb +0 -117
  55. data/lib/savon/soap/xml.rb +0 -257
  56. data/spec/savon/config_spec.rb +0 -38
  57. data/spec/savon/hooks/group_spec.rb +0 -71
  58. data/spec/savon/hooks/hook_spec.rb +0 -16
  59. data/spec/savon/http/error_spec.rb +0 -52
  60. data/spec/savon/logger_spec.rb +0 -51
  61. data/spec/savon/savon_spec.rb +0 -33
  62. data/spec/savon/soap/fault_spec.rb +0 -89
  63. data/spec/savon/soap/request_builder_spec.rb +0 -207
  64. data/spec/savon/soap/request_spec.rb +0 -112
  65. data/spec/savon/soap/xml_spec.rb +0 -357
  66. data/spec/savon/soap_spec.rb +0 -16
@@ -1,12 +1,14 @@
1
1
  require "bundler"
2
- Bundler.require :default, :development
2
+ Bundler.setup(:default, :development)
3
+
4
+ require "savon"
5
+ require "rspec"
3
6
 
4
7
  RSpec.configure do |config|
5
8
  config.mock_with :mocha
9
+ config.order = "random"
6
10
  end
7
11
 
8
- # Silence log output
9
- Savon.config.log = false
10
12
  HTTPI.log = false
11
13
 
12
14
  require "support/endpoint"
@@ -10,7 +10,7 @@ class Fixture
10
10
 
11
11
  def response_hash(fixture)
12
12
  @response_hash ||= {}
13
- @response_hash[fixture] ||= Nori.parse(response(fixture))[:envelope][:body]
13
+ @response_hash[fixture] ||= nori.parse(response(fixture))[:envelope][:body]
14
14
  end
15
15
 
16
16
  TYPES.each do |type, ext|
@@ -19,6 +19,10 @@ class Fixture
19
19
 
20
20
  private
21
21
 
22
+ def nori
23
+ Nori.new(:strip_namespaces => true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym })
24
+ end
25
+
22
26
  def fixtures(type)
23
27
  @fixtures ||= {}
24
28
  @fixtures[type] ||= {}
metadata CHANGED
@@ -1,204 +1,214 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: savon
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 2
9
- - 0
10
- version: 1.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Daniel Harrington
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-09-15 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-12-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nori
16
+ requirement: !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- hash: 19
28
- segments:
29
- - 1
30
- - 1
31
- - 0
32
- version: 1.1.0
33
- version_requirements: *id001
34
- name: nori
35
- prerelease: false
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
36
22
  type: :runtime
37
- - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
39
25
  none: false
40
- requirements:
26
+ requirements:
41
27
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 19
44
- segments:
45
- - 1
46
- - 1
47
- - 0
48
- version: 1.1.0
49
- version_requirements: *id002
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
30
+ - !ruby/object:Gem::Dependency
50
31
  name: httpi
51
- prerelease: false
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.0
52
38
  type: :runtime
53
- - !ruby/object:Gem::Dependency
54
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
55
41
  none: false
56
- requirements:
42
+ requirements:
57
43
  - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 27
60
- segments:
61
- - 2
62
- - 5
63
- - 0
64
- version: 2.5.0
65
- version_requirements: *id003
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.0
46
+ - !ruby/object:Gem::Dependency
66
47
  name: wasabi
67
- prerelease: false
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 3.0.0
68
54
  type: :runtime
69
- - !ruby/object:Gem::Dependency
70
- requirement: &id004 !ruby/object:Gem::Requirement
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
71
57
  none: false
72
- requirements:
58
+ requirements:
73
59
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 31
76
- segments:
77
- - 1
78
- - 2
79
- - 0
80
- version: 1.2.0
81
- version_requirements: *id004
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.0
62
+ - !ruby/object:Gem::Dependency
82
63
  name: akami
83
- prerelease: false
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 1.2.0
84
70
  type: :runtime
85
- - !ruby/object:Gem::Dependency
86
- requirement: &id005 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
87
73
  none: false
88
- requirements:
74
+ requirements:
89
75
  - - ~>
90
- - !ruby/object:Gem::Version
91
- hash: 5
92
- segments:
93
- - 0
94
- - 4
95
- - 5
96
- version: 0.4.5
97
- version_requirements: *id005
76
+ - !ruby/object:Gem::Version
77
+ version: 1.2.0
78
+ - !ruby/object:Gem::Dependency
98
79
  name: gyoku
99
- prerelease: false
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 1.0.0
100
86
  type: :runtime
101
- - !ruby/object:Gem::Dependency
102
- requirement: &id006 !ruby/object:Gem::Requirement
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
103
89
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 15
108
- segments:
109
- - 2
110
- - 1
111
- - 2
112
- version: 2.1.2
113
- version_requirements: *id006
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 1.0.0
94
+ - !ruby/object:Gem::Dependency
114
95
  name: builder
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 2.1.2
102
+ type: :runtime
115
103
  prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 2.1.2
110
+ - !ruby/object:Gem::Dependency
111
+ name: nokogiri
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.4.0
116
118
  type: :runtime
117
- - !ruby/object:Gem::Dependency
118
- requirement: &id007 !ruby/object:Gem::Requirement
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
119
121
  none: false
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- hash: 7
124
- segments:
125
- - 1
126
- - 4
127
- - 0
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
128
125
  version: 1.4.0
129
- version_requirements: *id007
130
- name: nokogiri
126
+ - !ruby/object:Gem::Dependency
127
+ name: rack
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
131
135
  prerelease: false
132
- type: :runtime
133
- - !ruby/object:Gem::Dependency
134
- requirement: &id008 !ruby/object:Gem::Requirement
136
+ version_requirements: !ruby/object:Gem::Requirement
135
137
  none: false
136
- requirements:
137
- - - ~>
138
- - !ruby/object:Gem::Version
139
- hash: 25
140
- segments:
141
- - 0
142
- - 9
143
- version: "0.9"
144
- version_requirements: *id008
145
- name: rake
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: puma
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: 2.0.0.b3
150
+ type: :development
146
151
  prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: 2.0.0.b3
158
+ - !ruby/object:Gem::Dependency
159
+ name: rake
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ~>
164
+ - !ruby/object:Gem::Version
165
+ version: '0.9'
147
166
  type: :development
148
- - !ruby/object:Gem::Dependency
149
- requirement: &id009 !ruby/object:Gem::Requirement
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
150
169
  none: false
151
- requirements:
170
+ requirements:
152
171
  - - ~>
153
- - !ruby/object:Gem::Version
154
- hash: 23
155
- segments:
156
- - 2
157
- - 10
158
- version: "2.10"
159
- version_requirements: *id009
172
+ - !ruby/object:Gem::Version
173
+ version: '0.9'
174
+ - !ruby/object:Gem::Dependency
160
175
  name: rspec
161
- prerelease: false
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ~>
180
+ - !ruby/object:Gem::Version
181
+ version: '2.10'
162
182
  type: :development
163
- - !ruby/object:Gem::Dependency
164
- requirement: &id010 !ruby/object:Gem::Requirement
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
165
185
  none: false
166
- requirements:
186
+ requirements:
167
187
  - - ~>
168
- - !ruby/object:Gem::Version
169
- hash: 29
170
- segments:
171
- - 0
172
- - 11
173
- version: "0.11"
174
- version_requirements: *id010
188
+ - !ruby/object:Gem::Version
189
+ version: '2.10'
190
+ - !ruby/object:Gem::Dependency
175
191
  name: mocha
176
- prerelease: false
177
- type: :development
178
- - !ruby/object:Gem::Dependency
179
- requirement: &id011 !ruby/object:Gem::Requirement
192
+ requirement: !ruby/object:Gem::Requirement
180
193
  none: false
181
- requirements:
194
+ requirements:
182
195
  - - ~>
183
- - !ruby/object:Gem::Version
184
- hash: 13
185
- segments:
186
- - 0
187
- - 3
188
- version: "0.3"
189
- version_requirements: *id011
190
- name: timecop
191
- prerelease: false
196
+ - !ruby/object:Gem::Version
197
+ version: '0.11'
192
198
  type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ~>
204
+ - !ruby/object:Gem::Version
205
+ version: '0.11'
193
206
  description: Delicious SOAP for the Ruby community
194
207
  email: me@rubiii.com
195
208
  executables: []
196
-
197
209
  extensions: []
198
-
199
210
  extra_rdoc_files: []
200
-
201
- files:
211
+ files:
202
212
  - .gitignore
203
213
  - .rspec
204
214
  - .travis.yml
@@ -209,24 +219,24 @@ files:
209
219
  - README.md
210
220
  - Rakefile
211
221
  - lib/savon.rb
222
+ - lib/savon/block_interface.rb
223
+ - lib/savon/builder.rb
212
224
  - lib/savon/client.rb
213
- - lib/savon/config.rb
214
225
  - lib/savon/core_ext/string.rb
215
- - lib/savon/error.rb
216
- - lib/savon/hooks/group.rb
217
- - lib/savon/hooks/hook.rb
218
- - lib/savon/http/error.rb
226
+ - lib/savon/header.rb
227
+ - lib/savon/http_error.rb
219
228
  - lib/savon/log_message.rb
220
- - lib/savon/logger.rb
229
+ - lib/savon/message.rb
230
+ - lib/savon/mock.rb
231
+ - lib/savon/mock/expectation.rb
232
+ - lib/savon/mock/spec_helper.rb
221
233
  - lib/savon/model.rb
222
- - lib/savon/null_logger.rb
223
- - lib/savon/soap.rb
224
- - lib/savon/soap/fault.rb
225
- - lib/savon/soap/invalid_response_error.rb
226
- - lib/savon/soap/request.rb
227
- - lib/savon/soap/request_builder.rb
228
- - lib/savon/soap/response.rb
229
- - lib/savon/soap/xml.rb
234
+ - lib/savon/operation.rb
235
+ - lib/savon/options.rb
236
+ - lib/savon/qualified_message.rb
237
+ - lib/savon/request.rb
238
+ - lib/savon/response.rb
239
+ - lib/savon/soap_fault.rb
230
240
  - lib/savon/version.rb
231
241
  - savon.gemspec
232
242
  - spec/fixtures/gzip/message.gz
@@ -243,58 +253,53 @@ files:
243
253
  - spec/fixtures/wsdl/multiple_namespaces.xml
244
254
  - spec/fixtures/wsdl/multiple_types.xml
245
255
  - spec/fixtures/wsdl/taxcloud.xml
256
+ - spec/integration/options_spec.rb
246
257
  - spec/integration/request_spec.rb
258
+ - spec/integration/support/application.rb
259
+ - spec/integration/support/server.rb
260
+ - spec/savon/builder_spec.rb
247
261
  - spec/savon/client_spec.rb
248
- - spec/savon/config_spec.rb
249
262
  - spec/savon/core_ext/string_spec.rb
250
- - spec/savon/hooks/group_spec.rb
251
- - spec/savon/hooks/hook_spec.rb
252
- - spec/savon/http/error_spec.rb
253
- - spec/savon/logger_spec.rb
263
+ - spec/savon/http_error_spec.rb
264
+ - spec/savon/log_message_spec.rb
265
+ - spec/savon/mock_spec.rb
254
266
  - spec/savon/model_spec.rb
255
- - spec/savon/savon_spec.rb
256
- - spec/savon/soap/fault_spec.rb
257
- - spec/savon/soap/request_builder_spec.rb
258
- - spec/savon/soap/request_spec.rb
259
- - spec/savon/soap/response_spec.rb
260
- - spec/savon/soap/xml_spec.rb
261
- - spec/savon/soap_spec.rb
267
+ - spec/savon/observers_spec.rb
268
+ - spec/savon/operation_spec.rb
269
+ - spec/savon/request_spec.rb
270
+ - spec/savon/response_spec.rb
271
+ - spec/savon/soap_fault_spec.rb
262
272
  - spec/spec_helper.rb
263
273
  - spec/support/endpoint.rb
264
274
  - spec/support/fixture.rb
265
- has_rdoc: true
266
275
  homepage: http://savonrb.com
267
276
  licenses: []
268
-
269
277
  post_install_message:
270
278
  rdoc_options: []
271
-
272
- require_paths:
279
+ require_paths:
273
280
  - lib
274
- required_ruby_version: !ruby/object:Gem::Requirement
281
+ required_ruby_version: !ruby/object:Gem::Requirement
275
282
  none: false
276
- requirements:
277
- - - ">="
278
- - !ruby/object:Gem::Version
279
- hash: 3
280
- segments:
283
+ requirements:
284
+ - - ! '>='
285
+ - !ruby/object:Gem::Version
286
+ version: '0'
287
+ segments:
281
288
  - 0
282
- version: "0"
283
- required_rubygems_version: !ruby/object:Gem::Requirement
289
+ hash: -4031726402379507170
290
+ required_rubygems_version: !ruby/object:Gem::Requirement
284
291
  none: false
285
- requirements:
286
- - - ">="
287
- - !ruby/object:Gem::Version
288
- hash: 3
289
- segments:
292
+ requirements:
293
+ - - ! '>='
294
+ - !ruby/object:Gem::Version
295
+ version: '0'
296
+ segments:
290
297
  - 0
291
- version: "0"
298
+ hash: -4031726402379507170
292
299
  requirements: []
293
-
294
300
  rubyforge_project: savon
295
- rubygems_version: 1.6.2
301
+ rubygems_version: 1.8.24
296
302
  signing_key:
297
303
  specification_version: 3
298
304
  summary: Heavy metal SOAP client
299
305
  test_files: []
300
-