soaspec 0.0.31 → 0.0.32

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: e08d39845eefbfb87ab3a5b7b8e6ae80fa321d54
4
- data.tar.gz: 7903a5ab815ef9d56c9b6223b1d945181c57317e
3
+ metadata.gz: 597b71f266eacf309da4a897e8e27a3601b55bd1
4
+ data.tar.gz: f5ad76b346a6dcee607d6b2976a6731ba85467c0
5
5
  SHA512:
6
- metadata.gz: ccf078e392801d2ff1686836701c4ded6afbb2166591ad543c6ba6fa7b54fa0946f637e5bfdb3401b0e90deb105751e01edc2040379295dc280bf64acded3528
7
- data.tar.gz: 2d8c97db2287c39369b0e6258202a3b446aa4c4e4375fd35af46402daf2bab6d5f260d93934d31852d089073549f5b94b7168ae6b85b99477387055388352b12
6
+ metadata.gz: 0a8f3cad9b2baadf8200a1af67bd7233efbf255d2f062782912c06e22316eebf28f23a96b62b8f7bba6749a5cf636bff3c67deffba21427db6381a6396eb9f02
7
+ data.tar.gz: fca37bd39cda4f3e78afa7cb25cc165ba4a8ebce3186c520f21dd97afff3031761cd8bb93d5302085b66ae10e4527e9cc278f088ec2fa0212786b86759faa63d
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.0.32 / 2018-3-9
2
+ * Enhancements
3
+ * Made :body key in hash that can be used to use JSON.generate for a payload when using rest_handler exchanges
4
+
1
5
  Version 0.0.31 / 2018-3-8
2
6
  * Enhancements
3
7
  * Compacted unit tests for exchange handler
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.31)
4
+ soaspec (0.0.32)
5
5
  rest-client (>= 2.0)
6
6
  rspec (~> 3.0)
7
7
  rspec-its (>= 1.2.0)
data/exe/soaspec-init CHANGED
@@ -65,7 +65,7 @@ soap_example.default_hash = { city_name: 'Sydney', country_name: 'Australia' }
65
65
  end
66
66
  end
67
67
 
68
- describe Exchange.new(:japan, data_for(:japan)) do
68
+ describe Exchange.new(:japan, data_for('default/japan')) do
69
69
  it_behaves_like 'success scenario'
70
70
  its(['//xmlns:GetWeatherResult']) { is_expected.to eq 'Data Not Found' } # Can specify namespace if wanted
71
71
  end
@@ -54,32 +54,27 @@ module Soaspec
54
54
  super
55
55
  end
56
56
 
57
- def name(name)
58
- @test_name = name
59
- self
60
- end
61
-
62
57
  # Used in together with Exchange request that passes such override parameters
63
58
  # @param [Hash] override_parameters Params to characterize REST request
59
+ # @param_value [params] Extra parameters (E.g. headers)
60
+ # @param_value [suburl] URL appended to base_url of clss
61
+ # @param_value [method] REST method (get, post, etc)
64
62
  def make_request(override_parameters)
65
63
  test_values = override_parameters
66
64
  test_values[:params] ||= {}
67
65
  test_values[:suburl] = test_values[:suburl].to_s if test_values[:suburl]
68
66
 
67
+ @resource_used = test_values[:suburl] ? @resource[test_values[:suburl]] : @resource
68
+
69
69
  begin
70
70
  response = case test_values[:method]
71
71
  when :post
72
- if test_values[:suburl]
73
- @resource[test_values[:suburl]].send(test_values[:method].to_s, test_values[:payload], test_values[:params])
74
- else
75
- @resource.send(test_values[:method].to_s, test_values[:payload], test_values[:params])
72
+ unless test_values[:payload]
73
+ test_values[:payload] = JSON.generate(test_values[:body]).to_s if test_values[:body]
76
74
  end
75
+ @resource_used.send(test_values[:method].to_s, test_values[:payload], test_values[:params])
77
76
  else
78
- if test_values[:suburl]
79
- @resource[test_values[:suburl]].send(test_values[:method].to_s, test_values[:params])
80
- else
81
- @resource.send(test_values[:method].to_s, test_values[:params])
82
- end
77
+ @resource_used.send(test_values[:method].to_s, test_values[:params])
83
78
  end
84
79
  rescue RestClient::ExceptionWithResponse => e
85
80
  response = e.response
@@ -79,11 +79,6 @@ module Soaspec
79
79
  super
80
80
  end
81
81
 
82
- def name(name)
83
- @test_name = name
84
- self
85
- end
86
-
87
82
  # Used in together with Exchange request that passes such override parameters
88
83
  def make_request(override_parameters)
89
84
  test_values = override_parameters # Used in Erb
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.31'
2
+ VERSION = '0.0.32'
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.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA