soaspec 0.2.1 → 0.2.2

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: 0c9254d8c1b81ec357de07757ca14a755acd0fa5
4
- data.tar.gz: 73ae32fa4f6177094e1004709d1fe1d2250001b0
3
+ metadata.gz: 1be796f9ede9ecbecec8effaa198c8e7393e3648
4
+ data.tar.gz: c80d4e76e7e5fc58e7457fa774e5a3bd7a3932c5
5
5
  SHA512:
6
- metadata.gz: cdac65c8cc86cef1c33961bbc85afefecf71813756e78f395d80d5bbeb2ff7c0d1a27b42e4290ac7dce8bb67762cd542ebf5e7d5446db3b0cfda9ac7833a9ccd
7
- data.tar.gz: 93a00b0fafc13444ad7d818da0586d450a2a4c4d173253a7f453700bb1e3ec506692a42167ec4babb843f7d3450de15e9986e782763361e7bbb89ca261414b9f
6
+ metadata.gz: dadb8d208c81c5158d33790d2f308be0dd940b9ee5585a04b94fd5e88ffbbd31c26b5ffc4ae9f5a0c0f3ae797b89918f1b0dd0bdb87377abe18bc2b69557511b
7
+ data.tar.gz: c21ab190b0e65a5c750d1d0127c95df18069e31416698e33b7feeafd574ab3a5127ae74866f9d30b200513e266773e6a3c0bb5ed09b1496ead2bb75ee8c427ce
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.2.2
2
+ * Enhancements
3
+ * Make accessing test_values from template using indifferent access
4
+
1
5
  Version 0.2.1
2
6
  * Enhancements
3
7
  * Make method to access 'client_id' within a class after specifying 'oauth2_file' to remove unnecessarily loading file twice
@@ -9,6 +9,7 @@ require 'date'
9
9
  require 'jsonpath'
10
10
 
11
11
  require 'soaspec/version'
12
+ require 'soaspec/indifferent_hash'
12
13
  require 'soaspec/o_auth2'
13
14
  require 'soaspec/template_reader'
14
15
  require 'soaspec/exchange_handlers/soap_handler'
@@ -10,10 +10,8 @@ require 'json'
10
10
  require 'jsonpath'
11
11
  require 'nori'
12
12
  require 'erb'
13
- require 'hashie/extensions/indifferent_access'
14
13
 
15
14
  module Soaspec
16
-
17
15
  # Wraps around Savon client defining default values dependent on the soap request
18
16
  class RestHandler < ExchangeHandler
19
17
  extend Soaspec::RestParameters
@@ -263,6 +261,7 @@ module Soaspec
263
261
  test_values[:payload] = JSON.generate(hash_used_in_request(test_values[:body])).to_s
264
262
  elsif @request_option == :template
265
263
  test_values = test_values[:body].dup if test_values[:body]
264
+ test_values = IndifferentHash.new(test_values) # Allow test_values to be either Symbol or String
266
265
  Soaspec::TemplateReader.new.render_body(template_name, binding)
267
266
  else
268
267
  test_values[:payload]
@@ -100,6 +100,7 @@ module Soaspec
100
100
  # Call the SOAP operation with the request XML provided
101
101
  begin
102
102
  if @request_option == :template
103
+ test_values = IndifferentHash.new(test_values) # Allow test_values to be either Symbol or String
103
104
  client.call(operation, xml: Soaspec::TemplateReader.new.render_body(template_name, binding))
104
105
  elsif @request_option == :hash
105
106
  client.call(operation, message: @default_hash.merge(test_values), attributes: request_root_attributes)
@@ -0,0 +1,7 @@
1
+ require 'hashie'
2
+
3
+ # Hash that allows accessing hash with either string or Hash
4
+ class IndifferentHash < Hash
5
+ include Hashie::Extensions::MergeInitializer
6
+ include Hashie::Extensions::IndifferentAccess
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA
@@ -386,6 +386,7 @@ files:
386
386
  - lib/soaspec/generator/spec/soap_spec.rb.erb
387
387
  - lib/soaspec/generator/spec/spec_helper.rb.erb
388
388
  - lib/soaspec/generator/template/soap_template.xml
389
+ - lib/soaspec/indifferent_hash.rb
389
390
  - lib/soaspec/interpreter.rb
390
391
  - lib/soaspec/matchers.rb
391
392
  - lib/soaspec/not_found_errors.rb