testkit123 0.2.0 → 0.2.1
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -2
- data/lib/testkit123.rb +52 -5
- metadata +2 -2
- metadata.gz.sig +2 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32e08766c0a8bd2efd2f158d3b1f449b6a3adb86
|
4
|
+
data.tar.gz: 549a97950109645ad560d4eebab5b167eb58428f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 197b4c9a3424f5f07f53d02c2a1a0ee93318543f1519acdfeae24ae3eac3b09bdfbb15767bbdf2592322dc3408e470e9b0cdeb9dcf570042b61ce87ac0867b61
|
7
|
+
data.tar.gz: f52697330b11e27497a2832b89b24b51ac9f83a48077dbee259b722bbe43da6b45e634278a65d2079d193f177d5174aa5ec84da02684633664d32c6f012c2463
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
����)f
|
1
|
+
Z��XL&xgE����|КM-L�q��'p�[?B*�Z�8��m��6ψ���T��-�q�(�3�`y�/���7i�|̗��@�+�S7���ڞ��
|
data/lib/testkit123.rb
CHANGED
@@ -128,11 +128,13 @@ end
|
|
128
128
|
puts 'testdata_file: ' + testdata_file.inspect if @debug
|
129
129
|
|
130
130
|
s = File.read test_rbfile
|
131
|
+
require_gems = s.scan(/^require +['"]([^'"]+)/).map(&:first)
|
132
|
+
|
131
133
|
a = s.split(/(?= test )/)
|
132
134
|
a.shift
|
133
135
|
|
134
136
|
tests = a.map do |x|
|
135
|
-
r = a[0].match(/(?<=['"])(?<test>[^"']+)['"]\s+do\s+\|(?<raw_args>[^\|]+)/)
|
137
|
+
r = a[0].match(/(?<=['"])(?<test>[^"']+)['"]\s+do\s+\|(?<raw_args>[^\|]+)/)
|
136
138
|
|
137
139
|
[r[:test], r[:raw_args].split(/, */)]
|
138
140
|
end
|
@@ -155,15 +157,28 @@ end
|
|
155
157
|
|
156
158
|
testcode = a[i].strip.lines[1..-2].map do |line|
|
157
159
|
line.sub(/^ {6}/,'')
|
158
|
-
end
|
160
|
+
end.join
|
159
161
|
|
160
162
|
args = testnode.xpath('records/input/summary/*').map do |input|
|
161
|
-
"%s = '%s'" % [input.name, input.texts.join.gsub(/'/,"\'")]
|
163
|
+
"test_%s = '%s'" % [input.name, input.texts.join.gsub(/'/,"\'").strip]
|
164
|
+
end
|
165
|
+
|
166
|
+
vars = testnode.xpath('records/input/summary/*').map(&:name)
|
167
|
+
|
168
|
+
puts 'args: ' + args.inspect if @debug
|
169
|
+
|
170
|
+
vars.each do |var|
|
171
|
+
testcode.gsub!(/\b#{var}\b/, 'test_' + var)
|
162
172
|
end
|
163
173
|
|
164
|
-
puts '
|
174
|
+
puts 'gems: ' + require_gems.inspect if @debug
|
165
175
|
|
166
|
-
"
|
176
|
+
"# Test %d. Type: %s\n# Description: %s\n" \
|
177
|
+
% [n, title, testnode.text('summary/type')] + \
|
178
|
+
"# ----------------------\n\n" + \
|
179
|
+
"require '#{proj}'\n" + require_gems.map {|x| "require '%s'" \
|
180
|
+
% x}.join("\n") + "\n\n\n" \
|
181
|
+
+ args.join("\n") + testcode
|
167
182
|
|
168
183
|
end
|
169
184
|
|
@@ -193,6 +208,37 @@ end
|
|
193
208
|
proj + ' test files deleted'
|
194
209
|
|
195
210
|
end
|
211
|
+
|
212
|
+
def make_testdata(s)
|
213
|
+
|
214
|
+
inputs = s.scan(/test_([\w]+) += +['"]([^'"]+)/)\
|
215
|
+
.inject({}){|r,x| r.merge(x.first.to_sym => x.last)}
|
216
|
+
|
217
|
+
h = {
|
218
|
+
_test: {
|
219
|
+
summary: {
|
220
|
+
path: '',
|
221
|
+
type: '',
|
222
|
+
description: ''
|
223
|
+
},
|
224
|
+
records: {
|
225
|
+
input: {
|
226
|
+
summary: inputs,
|
227
|
+
records: {}
|
228
|
+
},
|
229
|
+
output: {
|
230
|
+
summary: {result: ''},
|
231
|
+
records: {}
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
a = RexleBuilder.new(h).to_a
|
238
|
+
|
239
|
+
Rexle.new(a).xml pretty: true
|
240
|
+
|
241
|
+
end
|
196
242
|
|
197
243
|
def new_project(project='myproject', classname=nil, save: false)
|
198
244
|
|
@@ -232,3 +278,4 @@ EOF
|
|
232
278
|
end
|
233
279
|
|
234
280
|
end
|
281
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testkit123
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
MBi32Noiyau3znLWYXucwnOR8dh4RhcwxaP82ZX6Up19+qVqJqravkDQ+OBff6o+
|
31
31
|
m3U=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-07-
|
33
|
+
date: 2018-07-28 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rxfhelper
|
metadata.gz.sig
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
Q�`Бca&Ůh�W�l-�>T&�%3���Y2�
|
3
|
-
� Z�:�f!�/��W���R�5Z����<uP`pxX�K���V+th�?��D�j�>{��zee�Ț��
|
4
|
-
���j~��
|
5
|
-
���$�Mt�C��3�<�D�5v_�
|
1
|
+
F�H�;�5`dUN<5��R���.���轌�Ʋ�
|
6
2
|
����f4~��es�2id���͙��_c ʯU�{����Tk.�|K��ὺw�?�b�q�Z�9�1~���I���������7Ƚ��G7���e�(dO5�Ԯ��
|
3
|
+
�/D/��bF���+
|