soaspec 0.0.39 → 0.0.40

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: 299efa5595bfbfa534193ee070b9398165219c39
4
- data.tar.gz: dba13a67d92ac44c2b0619ab17d1aa72804986e0
3
+ metadata.gz: 9aade838e7d024eb3dca086547ecaf6bed7e584b
4
+ data.tar.gz: 24947358f111dd3f1f4be9893db131a9c61a5f8a
5
5
  SHA512:
6
- metadata.gz: a5cff7eea1849ba64e8e6f7df40e9fe7ea697f7d0e66df54c7865f7fe2aa92a6599131de8d50ada6131fbb31cfdff4b7911574468837b329311fd75eac4bfe76
7
- data.tar.gz: e1e5be5d598535d8039b27bbac361c5ca6cb26e5541f70940a95eee623d8b8d17d0593a1987eac671434f741ab35edf268981b96053b906f97c3d8cb9abc4b9b
6
+ metadata.gz: '0883ca56888ff5929b05c540116a3547593e9b6b0bef689c65158861d2227363f8df0b2476fc0a9a6da8ceb86ede5851f91a9c063a3c8e78eaa6cd953f20af0d'
7
+ data.tar.gz: 1dbad99824910612e14afd61d77a73db07ae26a0e9f9a842fd407bf722b6d659fb05750eaece7bde8760ecc46915fa8d96472ddbf81af7ebf1a8fc710a1fecd5
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.0.40
2
+ * Enhancements
3
+ * soaspec-generate now handle a wsdl without parameters in the operation and rather look up input element type
4
+ * test_server virtual service now handle scenario where bank is not found and test made for that
5
+
1
6
  Version 0.0.39
2
7
  * Spec
3
8
  * Create task to use soaspec-init to create test structure and test it.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.39)
4
+ soaspec (0.0.40)
5
5
  jsonpath
6
6
  rest-client (>= 2.0)
7
7
  rspec (~> 3.0)
data/README.md CHANGED
@@ -20,13 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install soaspec
22
22
 
23
- ## Todo
24
-
25
- * Give examples and convenience methods for building classes for each SOAP or REST operation
26
- * Handle REST template (similar way to REST)
27
- * Potentially have in built use of 'vcr' and 'http_stub' gems
28
- * Handle proxies to record traffic for MiddleWare testing
29
- * Much more
23
+ [Things to be done](Todo.md)
30
24
 
31
25
  ## Getting Started
32
26
 
data/Rakefile CHANGED
@@ -33,6 +33,6 @@ CLOBBER.include 'logs/*'
33
33
 
34
34
  desc 'Start virtual web service'
35
35
  task :start_test_server do
36
- ENV['test_server_pid'] = Process.spawn('ruby', 'spec/test_server.rb').to_s #, err: "/dev/null").to_s - TODO: use to turn off debugging
36
+ ENV['test_server_pid'] = Process.spawn('ruby', 'spec/test_server.rb', err: "/dev/null").to_s
37
37
  puts 'Running test server at pid ' + ENV['test_server_pid']
38
38
  end
data/Todo.md CHANGED
@@ -1,2 +1,7 @@
1
1
  * SoapHandler - define xhange method for each SOAP operation
2
- * exchange add fields to overide parameters to support cucumber steps. exchange[from_temp]
2
+ * exchange add fields to overide parameters to support cucumber steps. exchange[from_temp]
3
+ * Give examples and convenience methods for building classes for each SOAP or REST operation
4
+ * Handle REST template (similar way to REST)
5
+ * Potentially have in built use of 'vcr' and 'http_stub' gems
6
+ * Handle proxies to record traffic for MiddleWare testing
7
+ * Much more
data/exe/soaspec-generate CHANGED
@@ -27,6 +27,12 @@ def try_enum_for(type)
27
27
  end
28
28
  end
29
29
 
30
+ def value_after_namespace(string)
31
+ string.split(':').last
32
+ end
33
+
34
+ # Based on WSDL type return a valid value
35
+ # @param [String] type Type without the WSDL
30
36
  def fill_in_field_from_type(type)
31
37
  case type
32
38
  when 'string'
@@ -129,6 +135,19 @@ end
129
135
 
130
136
  EOF
131
137
 
138
+ # @param [Nokogiri::NodeSet] list List
139
+ def wsdl_to_yaml_for(list)
140
+ puts list
141
+ list.each do |element|
142
+ name = element['name']
143
+ type = value_after_namespace(element['type'])
144
+ puts 'Name ' + name + ' type ' + type
145
+ @use_camel_case = true if (/[[:upper:]]/.match(name[0]) != nil)
146
+ @content += " #{name.snakecase}: #{fill_in_field_from_type(type)} # #{type} \n"
147
+ # TODO: If details is a Hash need to loop again
148
+ end
149
+ end
150
+
132
151
  name_of_wsdl
133
152
  ask_wsdl
134
153
 
@@ -167,6 +186,10 @@ create_file filename: "lib/#{@name.to_s.snakecase}.rb", content: ERB.new(@class_
167
186
  end
168
187
  end
169
188
 
189
+ root_type = @wsdl_schemas.at_xpath("//*[@name='#{details[:input]}']")['type'].split(':').last
190
+ root_elements = @wsdl_schemas.xpath("//*[@name='#{root_type}']//xsd:element")
191
+ wsdl_to_yaml_for root_elements
192
+
170
193
  params = []
171
194
  params << 'convert_request_keys_to: :camelcase' if @use_camel_case
172
195
  params_string = params == [] ? '' : ', ' + params.join(', ')
data/exe/soaspec-init CHANGED
@@ -52,7 +52,7 @@ id = '70070010'
52
52
  hash_example.default_hash = { blz: id }
53
53
 
54
54
 
55
- context 'BasicSoapHandler', '#default_hash' do
55
+ context 'Test Examples' do
56
56
  context hash_example do
57
57
 
58
58
  describe Exchange.new(:default) do
@@ -91,7 +91,7 @@ error_example = BLZService.new('Error example')
91
91
  error_example.operation = :get_bank
92
92
  error_example.default_hash = {}
93
93
 
94
- context 'error scenarios' do
94
+ context 'Error Examples' do
95
95
  context error_example do
96
96
  describe Exchange.new(:no_blz_error) do
97
97
  it_behaves_like 'error scenario'
@@ -91,7 +91,7 @@ RSpec.configure do |config|
91
91
 
92
92
  # Close test server after all RSpec tests have run
93
93
  config.after(:suite) do
94
- Process.kill(:QUIT, ENV['test_server_pid'].to_i) # && Process.wait - causes failure
94
+ Process.kill(:QUIT, ENV['test_server_pid'].to_i) if ENV['test_server_pid'] # && Process.wait - causes failure
95
95
  end
96
96
 
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.39'
2
+ VERSION = '0.0.40'
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.39
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA