soaspec 0.0.75 → 0.0.76

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a8fec6c74ba6ad782e2dce4d39a49d1dbc719ee
4
- data.tar.gz: 919092a45ef2d124747918a65377b326f0ea1394
3
+ metadata.gz: 6c81bc329ff3d5ea409f8842d6de0d4435584a7b
4
+ data.tar.gz: db52504cab243e4bce49dcf3e6d594cf017eb543
5
5
  SHA512:
6
- metadata.gz: 2925eca0d16b2598d2f441a0f897d218203eacc55f218ae83e4dd8e245cddb453274bc0bddb421ecff3349b3fcaeedd29128278627c385f9005c68aed5603c0f
7
- data.tar.gz: a495c1ac581a044b6df14abc29ecb871d03bc0b1ed804b3aa78f29f951cb4f1a4176ec37175cad0e7749b5fcbac8f9e4aeb3a0cc1258bb4ee9a86e32947ea505
6
+ metadata.gz: 2c4344b6b2de4ff083ae273740698e1bdc4f203db777bc133183e75110a79089fee3676551a384fba82f8edfa3c92b7b6211d55857471179e440b2450ec2905a
7
+ data.tar.gz: 7ab42d4c4e2e347b1856d37ca4accd6d2168949500be62a69bba0fa50c822cd208c96deb41c338ed50544f636e8531d1af647ebcabf2cb888da58b961d7cb7e0
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ Version 0.0.76
2
+ * Bug fix
3
+ * Fixed BLZService scenario on soaspec-virtual-server
4
+ * Fixed return value for retry_for_success failure
5
+ * Enhancements
6
+ * Added method to indicate a factory create should actually return a failure status
7
+
1
8
  Version 0.0.75
2
9
  * Enhancements
3
10
  * For Factory created methods, set retry_for_success to true. Allow for this to be set at Exchange class level
@@ -39,6 +39,8 @@ class Exchange
39
39
  attr_accessor :retry_count
40
40
  # Name used for displaying class
41
41
  attr_accessor :test_name
42
+ # Expect Factory to fail upon trying to create
43
+ attr_writer :fail_factory
42
44
 
43
45
  # Set retry for success variable to true so that request will be retried
44
46
  # for retry_count until it's true
@@ -80,6 +82,7 @@ class Exchange
80
82
  # As a last resort this uses the global parameter. The handler should be set straight before an exchange is made to use this
81
83
  @exchange_handler ||= default_handler_used || Soaspec.api_handler
82
84
  raise '@exchange_handler not set. Set either with `Soaspec.api_handler = Handler.new` or within the exchange' unless @exchange_handler
85
+ @fail_factory = nil
83
86
  @override_parameters = override_parameters
84
87
  @retry_for_success = false
85
88
  self.retry_count = 3
@@ -104,11 +107,11 @@ class Exchange
104
107
  def make_request
105
108
  Soaspec::SpecLogger.add_to 'Example ' + test_name
106
109
  request_params = @override_parameters
107
- retry_count.times do
108
- response = @exchange_handler.make_request(request_params)
110
+ (1..retry_count).each do |count|
111
+ response = exchange_handler.make_request(request_params)
109
112
  return response unless retry_for_success?
110
113
  return response if (200..299).cover? @exchange_handler.status_code_for(response)
111
- response
114
+ break response if count == retry_count
112
115
  end
113
116
  end
114
117
 
@@ -212,7 +215,7 @@ class Exchange
212
215
  # Used by FactoryBot
213
216
  # @return [Self]
214
217
  def save!
215
- @retry_for_success = true # Assume using Factory you'll want a positive response
218
+ @retry_for_success = @fail_factory ? false : true
216
219
  call
217
220
  self
218
221
  end
@@ -144,8 +144,9 @@ module Soaspec
144
144
  blz_element = doc.at_xpath('//tns:blz')
145
145
  return 500, error_response_template unless blz_element
146
146
  @bank_name = blz_element.inner_text
147
- return 500, ERB.new(bank_not_found).result(binding) if @bank_name.to_i == 0
148
- @title = 'DAB Bank' if @bank_id == '500'
147
+ @bank_id = @bank_name.to_i
148
+ return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
149
+ @title = 'DAB Bank' if @bank_id == 500
149
150
  ERB.new(success_response_template).result(binding)
150
151
  end
151
152
 
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.75'.freeze
2
+ VERSION = '0.0.76'.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.75
4
+ version: 0.0.76
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-11 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler