soaspec 0.0.80 → 0.0.81
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/ChangeLog +4 -0
- data/Todo.md +3 -5
- data/lib/soaspec/exchange_handlers/soap_handler.rb +31 -9
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0ce7232476ee664c72f0da3b4de626f492cde07
|
4
|
+
data.tar.gz: 9201c90f1c9556586658cc55e5bb1d790469c393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79afd7ed3dc188bffd720dff83647164f12cf9fe64603e51938dab0a5d8189bc08cd8401c3d5a82abebf5773d36cad670daf6af7d0ad0aa6cc8f77bd49ddcdfa
|
7
|
+
data.tar.gz: 978cdd1b657de34b2f858b633183b6f23c69073a2c170b30eca213f3412cb5d8adb9f1b8ab85517c00d6f7fcb1ae4136bf891e1144120376c9ae0567305caa53
|
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
Version 0.0.81
|
2
|
+
* Enhancements
|
3
|
+
* SoapHandler - define exchange method for each SOAP operation. See `one_off_spec` for example
|
4
|
+
|
1
5
|
Version 0.0.80
|
2
6
|
* Enhancements
|
3
7
|
* `values_from_path` method on `RestHandler` to easily extract multiple values for an xpath or json path
|
data/Todo.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
* SoapHandler - define exhange method for each SOAP operation
|
2
|
-
* exchange add fields to overide parameters to support cucumber steps. exchange[from_temp] =
|
3
|
-
* Demonstrate using Cucumber
|
4
1
|
* Give examples and convenience methods for building classes for each SOAP or REST operation
|
2
|
+
* For SOAP give example of basic_auth
|
5
3
|
* Handle REST template (similar way to SOAP)
|
6
|
-
*
|
4
|
+
* Get wsdl generator working for non complex gems
|
7
5
|
* Potentially have in built use of 'vcr' and 'http_stub' gems
|
8
6
|
* Handle proxies to record traffic for MiddleWare testing
|
9
|
-
* Much more
|
7
|
+
* Much more - please raise an issue for suggestion
|
@@ -4,23 +4,26 @@ require_relative '../core_ext/hash'
|
|
4
4
|
require_relative '../not_found_errors'
|
5
5
|
require_relative 'handler_accessors'
|
6
6
|
require_relative '../interpreter'
|
7
|
+
require 'forwardable'
|
7
8
|
|
8
9
|
module Soaspec
|
9
10
|
|
10
11
|
# Accessors specific to SOAP handler
|
11
12
|
module SoapAccessors
|
12
|
-
|
13
|
+
# Define attributes set on root SOAP element
|
13
14
|
def root_attributes(attributes)
|
14
15
|
define_method('request_root_attributes') do
|
15
16
|
attributes
|
16
17
|
end
|
17
18
|
end
|
18
|
-
|
19
19
|
end
|
20
20
|
|
21
21
|
# Wraps around Savon client defining default values dependent on the soap request
|
22
22
|
class SoapHandler < ExchangeHandler
|
23
23
|
extend Soaspec::SoapAccessors
|
24
|
+
extend Forwardable
|
25
|
+
|
26
|
+
delegate [:operations] => :client
|
24
27
|
|
25
28
|
# Savon client used to make SOAP calls
|
26
29
|
attr_accessor :client
|
@@ -83,7 +86,7 @@ module Soaspec
|
|
83
86
|
merged_options = default_options.merge logging_options
|
84
87
|
merged_options.merge! savon_options
|
85
88
|
merged_options.merge!(options)
|
86
|
-
|
89
|
+
self.client = Savon.client(merged_options)
|
87
90
|
end
|
88
91
|
|
89
92
|
# Used in making request via hash or in template via Erb
|
@@ -197,14 +200,33 @@ module Soaspec
|
|
197
200
|
def include_value?(response, expected_value)
|
198
201
|
response.body.include_value?(expected_value)
|
199
202
|
end
|
200
|
-
end
|
201
203
|
|
202
|
-
|
203
|
-
|
204
|
+
# Convenience methods for once off usage of a SOAP request
|
205
|
+
class << self
|
206
|
+
|
207
|
+
# Implement undefined setter with []= for FactoryBot to use without needing to define params to set
|
208
|
+
# @param [Object] method_name Name of method not defined
|
209
|
+
# @param [Object] args Arguments passed to method
|
210
|
+
# @param [Object] block
|
211
|
+
def method_missing(method_name, *args, &block)
|
212
|
+
tmp_class = new(method_name)
|
213
|
+
operations = tmp_class.operations
|
214
|
+
if operations.include? method_name
|
215
|
+
tmp_class.operation = method_name
|
216
|
+
exchange = Exchange.new(method_name, *args)
|
217
|
+
exchange.exchange_handler = tmp_class
|
218
|
+
exchange
|
219
|
+
else
|
220
|
+
super
|
221
|
+
end
|
222
|
+
end
|
204
223
|
|
205
|
-
|
206
|
-
|
207
|
-
|
224
|
+
def respond_to_missing?(method_name, *args)
|
225
|
+
tmp_class = new(args)
|
226
|
+
operations = tmp_class.operations
|
227
|
+
operations.include?(method_name) || super
|
228
|
+
end
|
208
229
|
end
|
230
|
+
|
209
231
|
end
|
210
232
|
end
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.81
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|