testdata 1.0.0 → 1.0.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 +0 -0
- data/lib/testdata.rb +35 -24
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f8d9fe4d60de15d824bb0da6bae1dce8ad454b7
|
4
|
+
data.tar.gz: ce50cbda243bf612396d702b10771e48df26aff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e30c97857c85642e69947e59aa0ed0f321fb6f95111ebceaf178fc73d9084bf6b0128ad13af088d35a2e27ee064258d211fa77149c75b9e083633fd0407c3f
|
7
|
+
data.tar.gz: 335add2792ccaf8088951b2baca99314a1c695c63314972eb465568a2eb244adaaa929f1794c734da7951282d5438a8a1d6bf46448bedd1b331896b3bba034f8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/testdata.rb
CHANGED
@@ -62,9 +62,7 @@ module Testdata
|
|
62
62
|
private
|
63
63
|
|
64
64
|
def testdata_values(id)
|
65
|
-
|
66
65
|
|
67
|
-
|
68
66
|
node = @doc.root.element "records/test[summary/path='#{id}']"
|
69
67
|
|
70
68
|
raise TestdataException, "Path error: node title not found" unless node
|
@@ -83,7 +81,7 @@ module Testdata
|
|
83
81
|
|
84
82
|
xpath = "records/output/summary/*"
|
85
83
|
output_nodes = node.xpath(xpath) #[1..-1]
|
86
|
-
output_values =
|
84
|
+
output_values = output_nodes.map{|x| x.texts.map(&:unescape).join.strip}
|
87
85
|
|
88
86
|
[path_no, input_values, input_names, type, output_values, desc]
|
89
87
|
|
@@ -202,42 +200,55 @@ module Testdata
|
|
202
200
|
def initialize(s)
|
203
201
|
|
204
202
|
super()
|
205
|
-
@
|
203
|
+
@a = []
|
206
204
|
|
207
205
|
buffer, _ = RXFHelper.read(s)
|
208
206
|
|
209
|
-
doc = Rexle.new(buffer)
|
210
|
-
|
211
|
-
# get the template
|
212
|
-
template = doc.root.xpath('summary/test_unit/text()').join.strip
|
213
|
-
raise 'no test_unit template found' unless template
|
207
|
+
@doc = Rexle.new(buffer)
|
214
208
|
|
215
|
-
doc.root.xpath('records/test').map do |test|
|
216
|
-
path, type, description = test.xpath('summary/*/text()')
|
209
|
+
@doc.root.xpath('records/test').map do |test|
|
217
210
|
|
218
|
-
|
219
|
-
|
220
|
-
records = test.element('records')
|
211
|
+
path, type, description = test.xpath('summary/*/text()')
|
212
|
+
records = test.element('records')
|
221
213
|
|
222
214
|
inputs = records.xpath('input/summary/*').map\
|
223
215
|
{|x| [x.name, x.texts.join.strip]}
|
224
|
-
inputs.each do |name, value|
|
225
|
-
template.sub!(/<%=\s*input\.#{name}\s*%>/, \
|
226
|
-
'"' + value.gsub('"','\"') + '"')
|
227
|
-
end
|
228
216
|
|
229
217
|
outputs = records.xpath('output/summary/*').map\
|
230
218
|
{|x| [x.name, x.texts.join.strip]}
|
231
|
-
outputs.each do |name, value|
|
232
|
-
template.sub!(/<%=\s*output\.#{name}\s*%>/, \
|
233
|
-
'"' + value.gsub('"','\"') + '"')
|
234
|
-
end
|
235
219
|
|
236
|
-
@
|
220
|
+
@a << {type: type, in: inputs, out: outputs}
|
237
221
|
|
238
222
|
end
|
239
223
|
|
240
224
|
end # end of initialize()
|
241
|
-
|
225
|
+
|
226
|
+
def to_s()
|
227
|
+
=begin
|
228
|
+
s = %Q(
|
229
|
+
require_relative "#{testgem}"
|
230
|
+
require "test/unit"
|
231
|
+
|
232
|
+
class #{testclass} < Test::Unit::TestCase
|
233
|
+
|
234
|
+
def #{types[i]}
|
235
|
+
#{@lines.join("\n ")}
|
236
|
+
end
|
242
237
|
|
238
|
+
end
|
239
|
+
)
|
240
|
+
=end
|
241
|
+
#read the .rsf file
|
242
|
+
script = @doc.root.element('summary/script/text()')
|
243
|
+
raise 'script XML entry not found' unless script
|
244
|
+
|
245
|
+
if script then
|
246
|
+
filename = script[/[\/]+\.rsf$/]
|
247
|
+
buffer, _ = RXFHelper.read(filename)
|
248
|
+
end
|
249
|
+
#@a.group_by {|x| x[:type]}
|
250
|
+
|
251
|
+
|
252
|
+
end
|
253
|
+
end
|
243
254
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
vWFtb5VPsjLRwClW20j7R9zEUv5XjYoyxcUn1W1xQINMVIQMtvMhouLBeWTXF7g4
|
32
32
|
ab2xQAvsYawLTw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-02-
|
34
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: app-routes
|
metadata.gz.sig
CHANGED
Binary file
|