soaspec 0.0.80 → 0.0.81

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da0b04fa67877430f80b6850de438eddff6ebec0
4
- data.tar.gz: 6ab2a8342e27068d1e8004ba2d37f3183222f7e2
3
+ metadata.gz: d0ce7232476ee664c72f0da3b4de626f492cde07
4
+ data.tar.gz: 9201c90f1c9556586658cc55e5bb1d790469c393
5
5
  SHA512:
6
- metadata.gz: de6404bc0e90325c946b83cb4d98283f272b72747474892bb07aa2ef11387ea54972762ca27598e60fc58dc50494a60377fcea4c0bc3a0e12169b10bba57a463
7
- data.tar.gz: 656f597d657333dd8c2159d03a3608dedef0026f2d2017ed0a5ce468067c4918a2e850a3c8e12f8bab6bd09cb3f99fcd520068a221280c4d7c558c9f6abec795
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
- * spec for oauth demonstrating sharing same oauth params across multiple classes
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
- @client = Savon.client(merged_options)
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
- # Deprecated class name. Will be removed in the future
203
- class BasicSoapHandler < SoapHandler
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
- def initialize(name, specific_options = {})
206
- super
207
- warn "'BasicSoapHandler' class is Deprecated. Please use 'SoapHandler' instead"
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
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.80'.freeze
2
+ VERSION = '0.0.81'.freeze
3
3
  end
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.80
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-06-27 00:00:00.000000000 Z
11
+ date: 2018-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler