soaspec 0.2.24 → 0.2.25
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 +5 -5
- data/.gitignore +15 -15
- data/.gitlab-ci.yml +51 -33
- data/.rspec +3 -3
- data/.rubocop.yml +2 -2
- data/CODE_OF_CONDUCT.md +74 -74
- data/ChangeLog +588 -577
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +230 -230
- data/Rakefile +50 -42
- data/Todo.md +15 -15
- data/exe/soaspec +137 -123
- data/exe/xml_to_yaml_file +42 -42
- data/lib/soaspec.rb +103 -101
- data/lib/soaspec/core_ext/hash.rb +42 -35
- data/lib/soaspec/cucumber/generic_steps.rb +85 -85
- data/lib/soaspec/demo.rb +4 -4
- data/lib/soaspec/exchange/exchange.rb +117 -111
- data/lib/soaspec/exchange/exchange_extractor.rb +83 -83
- data/lib/soaspec/exchange/exchange_properties.rb +26 -26
- data/lib/soaspec/exchange/exchange_repeater.rb +19 -19
- data/lib/soaspec/exchange/request_builder.rb +68 -68
- data/lib/soaspec/exchange/variable_storer.rb +22 -22
- data/lib/soaspec/exchange_handlers/exchange_handler.rb +130 -126
- data/lib/soaspec/exchange_handlers/handler_accessors.rb +130 -130
- data/lib/soaspec/exchange_handlers/request/rest_request.rb +49 -0
- data/lib/soaspec/exchange_handlers/request/soap_request.rb +39 -0
- data/lib/soaspec/exchange_handlers/response_extractor.rb +82 -82
- data/lib/soaspec/exchange_handlers/rest_exchanger_factory.rb +109 -109
- data/lib/soaspec/exchange_handlers/rest_handler.rb +287 -259
- data/lib/soaspec/exchange_handlers/rest_methods.rb +63 -44
- data/lib/soaspec/exchange_handlers/rest_parameters.rb +90 -86
- data/lib/soaspec/exchange_handlers/rest_parameters_defaults.rb +40 -21
- data/lib/soaspec/exchange_handlers/soap_handler.rb +239 -235
- data/lib/soaspec/exe_helpers.rb +92 -92
- data/lib/soaspec/generate_server.rb +46 -37
- data/lib/soaspec/generator/.rspec.erb +5 -5
- data/lib/soaspec/generator/.travis.yml.erb +5 -5
- data/lib/soaspec/generator/Gemfile.erb +8 -8
- data/lib/soaspec/generator/README.md.erb +29 -29
- data/lib/soaspec/generator/Rakefile.erb +19 -19
- data/lib/soaspec/generator/config/data/default.yml.erb +2 -2
- data/lib/soaspec/generator/css/bootstrap.css +6833 -6833
- data/lib/soaspec/generator/features/support/env.rb.erb +3 -0
- data/lib/soaspec/generator/generate_exchange.html.erb +47 -35
- data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
- data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
- data/lib/soaspec/generator/lib/new_rest_service.rb.erb +56 -51
- data/lib/soaspec/generator/lib/new_soap_service.rb.erb +29 -29
- data/lib/soaspec/generator/lib/package_service.rb.erb +2 -2
- data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
- data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
- data/lib/soaspec/generator/spec/rest_spec.rb.erb +9 -9
- data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
- data/lib/soaspec/generator/spec/spec_helper.rb.erb +23 -23
- data/lib/soaspec/generator/template/soap_template.xml +6 -6
- data/lib/soaspec/indifferent_hash.rb +7 -7
- data/lib/soaspec/interpreter.rb +39 -39
- data/lib/soaspec/matchers.rb +114 -114
- data/lib/soaspec/not_found_errors.rb +13 -13
- data/lib/soaspec/o_auth2.rb +128 -128
- data/lib/soaspec/soaspec_shared_examples.rb +24 -24
- data/lib/soaspec/spec_logger.rb +122 -121
- data/lib/soaspec/template_reader.rb +28 -28
- data/lib/soaspec/test_server/bank.wsdl +90 -90
- data/lib/soaspec/test_server/get_bank.rb +164 -164
- data/lib/soaspec/test_server/id_manager.rb +39 -39
- data/lib/soaspec/test_server/invoices.rb +27 -27
- data/lib/soaspec/test_server/namespace.xml +14 -14
- data/lib/soaspec/test_server/note.xml +5 -5
- data/lib/soaspec/test_server/puppy_service.rb +19 -19
- data/lib/soaspec/test_server/test_attribute.rb +12 -12
- data/lib/soaspec/test_server/test_namespace.rb +12 -12
- data/lib/soaspec/version.rb +4 -4
- data/lib/soaspec/virtual_server.rb +174 -174
- data/lib/soaspec/wait.rb +41 -41
- data/lib/soaspec/wsdl_generator.rb +215 -215
- data/soaspec.gemspec +56 -53
- data/test.wsdl +116 -116
- data/test.xml +10 -10
- data/test_wsdl.rb +41 -41
- metadata +38 -6
@@ -1,19 +1,19 @@
|
|
1
|
-
module Soaspec
|
2
|
-
# Ways of repeating an exchange to reach a desired outcome
|
3
|
-
module ExchangeRepeater
|
4
|
-
# Wait until the passed block returns true
|
5
|
-
# @param [Hash] opts Options for this instance
|
6
|
-
# @option opts [Numeric] :timeout (5) Seconds to wait before timing out.
|
7
|
-
# @option opts [Numeric] :interval (0.2) Seconds to sleep between polls.
|
8
|
-
# @option opts [String] :message Exception message if timed out.
|
9
|
-
# @option opts [Array, Exception] :ignore Exceptions to ignore while polling (default: Error::NoSuchElementError)
|
10
|
-
# @return [Self] Returns itself so operations can be done on the exchange after it's done waiting
|
11
|
-
def until(opts = {}, &script)
|
12
|
-
Soaspec::Wait.until(opts) do
|
13
|
-
@response = nil # Reset response so it can be made repeatedly
|
14
|
-
instance_eval(&script)
|
15
|
-
end
|
16
|
-
self
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
1
|
+
module Soaspec
|
2
|
+
# Ways of repeating an exchange to reach a desired outcome
|
3
|
+
module ExchangeRepeater
|
4
|
+
# Wait until the passed block returns true
|
5
|
+
# @param [Hash] opts Options for this instance
|
6
|
+
# @option opts [Numeric] :timeout (5) Seconds to wait before timing out.
|
7
|
+
# @option opts [Numeric] :interval (0.2) Seconds to sleep between polls.
|
8
|
+
# @option opts [String] :message Exception message if timed out.
|
9
|
+
# @option opts [Array, Exception] :ignore Exceptions to ignore while polling (default: Error::NoSuchElementError)
|
10
|
+
# @return [Self] Returns itself so operations can be done on the exchange after it's done waiting
|
11
|
+
def until(opts = {}, &script)
|
12
|
+
Soaspec::Wait.until(opts) do
|
13
|
+
@response = nil # Reset response so it can be made repeatedly
|
14
|
+
instance_eval(&script)
|
15
|
+
end
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,68 +1,68 @@
|
|
1
|
-
module Soaspec
|
2
|
-
# Methods to help build a Request
|
3
|
-
module RequestBuilder
|
4
|
-
# Specify a url to add onto the base_url of the ExchangeHandler used
|
5
|
-
# @param [String] url Url to add onto the base_url of the ExchangeHandler used
|
6
|
-
def suburl=(url)
|
7
|
-
@override_parameters[:suburl] = url
|
8
|
-
end
|
9
|
-
|
10
|
-
# Specify HTTP method to use. Default is :post
|
11
|
-
# @param [Symbol] method HTTP method. E.g, :get, :patch
|
12
|
-
def method=(method)
|
13
|
-
@override_parameters[:method] = method
|
14
|
-
end
|
15
|
-
|
16
|
-
# Set a parameter request in the request body.
|
17
|
-
# Can be used to build a request over several steps (e.g Cucumber)
|
18
|
-
# Will be used with FactoryBot
|
19
|
-
#
|
20
|
-
# @example
|
21
|
-
# exchange['name'] = 'tester'
|
22
|
-
# # Will set { name: tester } in the response, formatting as JSON or XML depending on REST / SOAP
|
23
|
-
# @param [String, Symbol] key Name of request element to set
|
24
|
-
# @param [String] value Value to set request element to
|
25
|
-
def []=(key, value)
|
26
|
-
@override_parameters[:body] ||= {}
|
27
|
-
@override_parameters[:body][key] = value
|
28
|
-
end
|
29
|
-
|
30
|
-
# Implement undefined setter with []= for FactoryBot to use without needing to define params to set
|
31
|
-
# @param [Object] method_name Name of method not defined
|
32
|
-
# @param [Object] args Arguments passed to method
|
33
|
-
# @param [Object] block Block passed to method
|
34
|
-
def method_missing(method_name, *args, &block)
|
35
|
-
set_value = args.first
|
36
|
-
if method_name[-1] == '=' # A setter method
|
37
|
-
getter_name = method_name[0..-2]
|
38
|
-
if set_value.class < Exchange # This would be prerequisite exchange
|
39
|
-
define_singleton_method(getter_name) { set_value }
|
40
|
-
self[getter_name] = set_value.id if set_value.respond_to?(:id)
|
41
|
-
else
|
42
|
-
self[getter_name] = set_value
|
43
|
-
end
|
44
|
-
else
|
45
|
-
super
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Used for setters that are not defined
|
50
|
-
# @param [String] method_name Name of method
|
51
|
-
# @param [Array] args List of arguments to method
|
52
|
-
def respond_to_missing?(method_name, *args)
|
53
|
-
method_name[-1] == '=' || super
|
54
|
-
end
|
55
|
-
|
56
|
-
# Makes request, caching the response and returning self
|
57
|
-
# Used by FactoryBot
|
58
|
-
# @return [Self] Return itself so methods can be called on itself afterwards
|
59
|
-
def save!
|
60
|
-
@retry_for_success = @fail_factory ? false : true
|
61
|
-
previous_setting = Soaspec.log_warnings
|
62
|
-
Soaspec.log_warnings = false # Don't log this warning as result of call not being used
|
63
|
-
call
|
64
|
-
Soaspec.log_warnings = previous_setting
|
65
|
-
self
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
1
|
+
module Soaspec
|
2
|
+
# Methods to help build a Request
|
3
|
+
module RequestBuilder
|
4
|
+
# Specify a url to add onto the base_url of the ExchangeHandler used
|
5
|
+
# @param [String] url Url to add onto the base_url of the ExchangeHandler used
|
6
|
+
def suburl=(url)
|
7
|
+
@override_parameters[:suburl] = url
|
8
|
+
end
|
9
|
+
|
10
|
+
# Specify HTTP method to use. Default is :post
|
11
|
+
# @param [Symbol] method HTTP method. E.g, :get, :patch
|
12
|
+
def method=(method)
|
13
|
+
@override_parameters[:method] = method
|
14
|
+
end
|
15
|
+
|
16
|
+
# Set a parameter request in the request body.
|
17
|
+
# Can be used to build a request over several steps (e.g Cucumber)
|
18
|
+
# Will be used with FactoryBot
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# exchange['name'] = 'tester'
|
22
|
+
# # Will set { name: tester } in the response, formatting as JSON or XML depending on REST / SOAP
|
23
|
+
# @param [String, Symbol] key Name of request element to set
|
24
|
+
# @param [String] value Value to set request element to
|
25
|
+
def []=(key, value)
|
26
|
+
@override_parameters[:body] ||= {}
|
27
|
+
@override_parameters[:body][key] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# Implement undefined setter with []= for FactoryBot to use without needing to define params to set
|
31
|
+
# @param [Object] method_name Name of method not defined
|
32
|
+
# @param [Object] args Arguments passed to method
|
33
|
+
# @param [Object] block Block passed to method
|
34
|
+
def method_missing(method_name, *args, &block)
|
35
|
+
set_value = args.first
|
36
|
+
if method_name[-1] == '=' # A setter method
|
37
|
+
getter_name = method_name[0..-2]
|
38
|
+
if set_value.class < Exchange # This would be prerequisite exchange
|
39
|
+
define_singleton_method(getter_name) { set_value }
|
40
|
+
self[getter_name] = set_value.id if set_value.respond_to?(:id)
|
41
|
+
else
|
42
|
+
self[getter_name] = set_value
|
43
|
+
end
|
44
|
+
else
|
45
|
+
super
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Used for setters that are not defined
|
50
|
+
# @param [String] method_name Name of method
|
51
|
+
# @param [Array] args List of arguments to method
|
52
|
+
def respond_to_missing?(method_name, *args)
|
53
|
+
method_name[-1] == '=' || super
|
54
|
+
end
|
55
|
+
|
56
|
+
# Makes request, caching the response and returning self
|
57
|
+
# Used by FactoryBot
|
58
|
+
# @return [Self] Return itself so methods can be called on itself afterwards
|
59
|
+
def save!
|
60
|
+
@retry_for_success = @fail_factory ? false : true
|
61
|
+
previous_setting = Soaspec.log_warnings
|
62
|
+
Soaspec.log_warnings = false # Don't log this warning as result of call not being used
|
63
|
+
call
|
64
|
+
Soaspec.log_warnings = previous_setting
|
65
|
+
self
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
module Soaspec
|
2
|
-
# Enables Exchange to store and retrieve variables so that one
|
3
|
-
# exchange can make assertions based on a previous one
|
4
|
-
module VariableStorer
|
5
|
-
# Stores a value in the api handler that can be accessed by the provided name
|
6
|
-
# @param [Symbol] name Name of method to use to access this value within handler
|
7
|
-
# @param [String] value Path to value to store
|
8
|
-
def store(name, value)
|
9
|
-
exchange_handler.store(name, self[value])
|
10
|
-
end
|
11
|
-
|
12
|
-
# Retrieve the stored value from the Api Handler
|
13
|
-
# @param [String, Symbol] name Name of value to retrieve
|
14
|
-
# @return [Object] value from the Api Handler stored previously
|
15
|
-
def retrieve(name)
|
16
|
-
method = '__stored_val__' + name.to_s
|
17
|
-
raise ArgumentError('Value not stored at ') unless exchange_handler.respond_to? method
|
18
|
-
|
19
|
-
exchange_handler.send(method)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
1
|
+
module Soaspec
|
2
|
+
# Enables Exchange to store and retrieve variables so that one
|
3
|
+
# exchange can make assertions based on a previous one
|
4
|
+
module VariableStorer
|
5
|
+
# Stores a value in the api handler that can be accessed by the provided name
|
6
|
+
# @param [Symbol] name Name of method to use to access this value within handler
|
7
|
+
# @param [String] value Path to value to store
|
8
|
+
def store(name, value)
|
9
|
+
exchange_handler.store(name, self[value])
|
10
|
+
end
|
11
|
+
|
12
|
+
# Retrieve the stored value from the Api Handler
|
13
|
+
# @param [String, Symbol] name Name of value to retrieve
|
14
|
+
# @return [Object] value from the Api Handler stored previously
|
15
|
+
def retrieve(name)
|
16
|
+
method = '__stored_val__' + name.to_s
|
17
|
+
raise ArgumentError('Value not stored at ') unless exchange_handler.respond_to? method
|
18
|
+
|
19
|
+
exchange_handler.send(method)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,126 +1,130 @@
|
|
1
|
-
require_relative 'handler_accessors'
|
2
|
-
|
3
|
-
module Soaspec
|
4
|
-
# Inherit this for a class describing how to implement a particular exchange.
|
5
|
-
# Has basic methods common for methods defining RSpec tests in YAML
|
6
|
-
class ExchangeHandler
|
7
|
-
extend Soaspec::HandlerAccessors
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
@
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
1
|
+
require_relative 'handler_accessors'
|
2
|
+
|
3
|
+
module Soaspec
|
4
|
+
# Inherit this for a class describing how to implement a particular exchange.
|
5
|
+
# Has basic methods common for methods defining RSpec tests in YAML
|
6
|
+
class ExchangeHandler
|
7
|
+
extend Soaspec::HandlerAccessors
|
8
|
+
|
9
|
+
# Use an instance of this ExchangeHandler in any further Exchange's
|
10
|
+
# This is a convenience method as it creates an ExchangeHandler behind the scenes
|
11
|
+
# @return [ExchangeHandler] Exchange handler instance created
|
12
|
+
def self.use
|
13
|
+
new.use
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [String] Name of the template file to be used in the API request
|
17
|
+
attr_reader :template_name
|
18
|
+
|
19
|
+
# Explicitly defined elements for which a path has been predefined
|
20
|
+
def elements
|
21
|
+
public_methods.select { |i| i[/__custom_path_.+/] }
|
22
|
+
end
|
23
|
+
|
24
|
+
# Set instance variable name
|
25
|
+
# @param [String, Symbol] name Name used when describing API test
|
26
|
+
# @param [Hash] _options Parameters defining handler. Used in descendants
|
27
|
+
def initialize(name = self.class.to_s, _options = {})
|
28
|
+
use
|
29
|
+
@request_option = :hash
|
30
|
+
raise ArgumentError, 'Cannot define both template_name and default_hash' if respond_to?(:template_name_value) && respond_to?(:default_hash_value)
|
31
|
+
|
32
|
+
@template_name = respond_to?(:template_name_value) ? template_name_value : ''
|
33
|
+
@default_hash = respond_to?(:default_hash_value) ? default_hash_value : {}
|
34
|
+
@name = name
|
35
|
+
end
|
36
|
+
|
37
|
+
# Set Api handler used by Exchange class to this handler
|
38
|
+
# @return [Self]
|
39
|
+
def use
|
40
|
+
Soaspec.api_handler = self
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
# Sets api handler variable globally. This is used in 'Exchange' class
|
45
|
+
# @return [String] Name set upon initialisation
|
46
|
+
def to_s
|
47
|
+
use
|
48
|
+
@name.to_s
|
49
|
+
end
|
50
|
+
|
51
|
+
# Set the default hash representing data to be used in making a request
|
52
|
+
# This will set the @request_option instance variable too
|
53
|
+
# @param [Hash] hash Hash to send in request body by default
|
54
|
+
def default_hash=(hash)
|
55
|
+
@request_option = :hash
|
56
|
+
@default_hash = Soaspec.always_use_keys? ? hash.transform_keys_to_symbols : hash
|
57
|
+
end
|
58
|
+
|
59
|
+
# Set the request option type and the template name
|
60
|
+
# Erb is used to parse the template file, executing Ruby code in `<%= %>` blocks to work out the final request
|
61
|
+
# @param [String] name Name of file inside 'template' folder excluding extension
|
62
|
+
def template_name=(name)
|
63
|
+
@request_option = :template
|
64
|
+
@template_name = name
|
65
|
+
end
|
66
|
+
|
67
|
+
# Will be used in 'success_scenarios' shared examples.
|
68
|
+
# Set though 'mandatory_elements' method
|
69
|
+
# @return [Array] Array of symbols specifying element names
|
70
|
+
def expected_mandatory_elements
|
71
|
+
[]
|
72
|
+
end
|
73
|
+
|
74
|
+
# Change this through 'mandatory_xpath_values' method to specify xpath results that must be present in the response
|
75
|
+
# Will be used in 'success_scenarios' shared examples
|
76
|
+
# @return [Hash] Hash of 'xpath' => 'expected value' pairs
|
77
|
+
def expected_mandatory_xpath_values
|
78
|
+
{}
|
79
|
+
end
|
80
|
+
|
81
|
+
# Change this through 'mandatory_json_values' method to specify json results that must be present in the response
|
82
|
+
# Will be used in 'success_scenarios' shared examples
|
83
|
+
# @return [Hash] Hash of 'json/path' => 'expected value' pairs
|
84
|
+
def expected_mandatory_json_values
|
85
|
+
{}
|
86
|
+
end
|
87
|
+
|
88
|
+
# @return [Boolean] Whether all xpaths will be done with XML that is converted to lower case
|
89
|
+
def convert_to_lower?
|
90
|
+
false
|
91
|
+
end
|
92
|
+
|
93
|
+
# Stores a value in a method that can be accessed by the provided name
|
94
|
+
# @param [Symbol] name Name of method to use to access this value within handler
|
95
|
+
# @param [String] value Value to store
|
96
|
+
def store(name, value)
|
97
|
+
define_singleton_method('__stored_val__' + name.to_s) { value }
|
98
|
+
end
|
99
|
+
|
100
|
+
# Set instance variable for each key in hash remove it from Hash
|
101
|
+
# @param [Hash] hash with items to remove from
|
102
|
+
# @param [Array] keys List of keys to remove from hash, setting each one
|
103
|
+
def set_remove_keys(hash, keys)
|
104
|
+
keys.each { |key| set_remove_key(hash, key) }
|
105
|
+
end
|
106
|
+
|
107
|
+
# Set instance variable and remove it from Hash
|
108
|
+
# @param [Hash] hash Hash to remove/retrieve keys from
|
109
|
+
# @param [String,Symbol] key Key to remove and to set instance variable for
|
110
|
+
def set_remove_key(hash, key)
|
111
|
+
return unless hash.key? key
|
112
|
+
|
113
|
+
__send__("#{key}=", hash[key])
|
114
|
+
hash.delete key
|
115
|
+
end
|
116
|
+
|
117
|
+
# @return [Boolean] Whether to remove namespaces in xpath assertion automatically
|
118
|
+
def strip_namespaces?
|
119
|
+
false
|
120
|
+
end
|
121
|
+
|
122
|
+
# Request of API call. Either intended request or actual request
|
123
|
+
# @param [Object] response Response from calling exchange
|
124
|
+
def request(response)
|
125
|
+
return "Request not yet sent Request option is #{@request_option}" unless response
|
126
|
+
|
127
|
+
'Specific API handler should implement this'
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|