soaspec 0.0.39 → 0.0.40
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 +4 -4
- data/ChangeLog +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -7
- data/Rakefile +1 -1
- data/Todo.md +6 -1
- data/exe/soaspec-generate +23 -0
- data/exe/soaspec-init +2 -2
- data/lib/soaspec/exe_helpers.rb +1 -1
- data/lib/soaspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aade838e7d024eb3dca086547ecaf6bed7e584b
|
4
|
+
data.tar.gz: 24947358f111dd3f1f4be9893db131a9c61a5f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/README.md
CHANGED
@@ -20,13 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install soaspec
|
22
22
|
|
23
|
-
|
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'
|
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 '
|
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 '
|
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'
|
data/lib/soaspec/exe_helpers.rb
CHANGED
@@ -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
|
data/lib/soaspec/version.rb
CHANGED