soaspec 0.0.14 → 0.0.15

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: 6202f11ed3bac43b110dbf5069cad49325550bf6
4
- data.tar.gz: 417b06d2b9ae9ac557e0e0b3e225bb7113aa3816
3
+ metadata.gz: fdba31fc0514774f52929a5d74be081121608461
4
+ data.tar.gz: 1a757b0ef66cab3fd56812fade4db84a95d8f972
5
5
  SHA512:
6
- metadata.gz: 630bdfc3d10e149b8923b22263614004896dab904b10cf12cef923cc2d717ade508fea859d8775b0c4e40dd7c138e0565b552197f3329ca2e49347ee3e0dc4e2
7
- data.tar.gz: 7bcccfe2739045f4cfcaccb021786299be0c780b59f36e5d6ad09a47d5503c0a692c285feb6badb974216ef017717ced9e8ce31a74d54544492ceea9148f0a89
6
+ metadata.gz: a1c489a68b27a6ede802285c3ad01e405d0073db617194cdbd64b9318d65eb6db3a94c32b6237a71186d1dcd65412c2523ff540bc1a0a752e0072841c5046135
7
+ data.tar.gz: 90c94d2d84258a167e490380590a0adbbae4b3ba66f2aedf2687326374e250334ce07fbb7bdbd262259a62ff82a159ef6ba679d77aa62c4a6a7aa39a81d4a7c6
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.0.15 / 2018-1-23
2
+ * Fixes
3
+ * Updated code to convert string key in Savon request to key automatically by default before passing to Savon. This saves
4
+ the user doing the conversion themselves.
5
+
1
6
  Version 0.0.14 / 2018-1-23
2
7
  * Fixes
3
8
  * Updated 'xml_to_yaml_file' exe to clean up YAML more. No more array for Hash value. Indenting needs work though.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.13)
4
+ soaspec (0.0.15)
5
5
  rest-client (>= 2.0)
6
6
  rspec (~> 3.0)
7
7
  rspec-its (>= 1.2.0)
data/lib/soaspec.rb CHANGED
@@ -26,6 +26,7 @@ module Soaspec
26
26
  # Represents Environment parameters used in Soaspec tests
27
27
  module Environment
28
28
 
29
+ # Used so that exchange class knows what context it's in
29
30
  def self.api_handler=(handler)
30
31
  @api_handler = handler
31
32
  end
@@ -33,5 +34,15 @@ module Soaspec
33
34
  def self.api_handler
34
35
  @api_handler
35
36
  end
37
+
38
+ # Whether to transform strings to keys automatically
39
+ def self.always_use_keys=(use_keys)
40
+ @always_use_keys = use_keys
41
+ end
42
+
43
+ def self.always_use_keys?
44
+ @always_use_keys || true
45
+ end
46
+
36
47
  end
37
48
  end
@@ -70,7 +70,7 @@ module Soaspec
70
70
  def make_request(override_parameters)
71
71
  test_values = override_parameters # Used in Erb
72
72
  # Erb parses template file, executing Ruby code in `<% %>` blocks to work out final request
73
- test_values = test_values.transform_keys_to_symbols # Either string or symbol
73
+ test_values = test_values.transform_keys_to_symbols unless Soaspec::Environment.always_use_keys?
74
74
  if @request_option == :template
75
75
  request_body = File.read('template/' + template_name + '.xml')
76
76
  render_body = ERB.new(request_body).result(binding)
@@ -82,7 +82,7 @@ module Soaspec
82
82
 
83
83
  def default_hash=(hash)
84
84
  @request_option = :hash
85
- @default_hash = hash
85
+ @default_hash = Soaspec::Environment.always_use_keys? ? hash.transform_keys_to_symbols : hash
86
86
  end
87
87
 
88
88
  def status_code_for(response)
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA