testdata 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/testdata.rb +7 -1
- metadata +1 -1
data/lib/testdata.rb
CHANGED
@@ -40,7 +40,7 @@ class Path
|
|
40
40
|
raise "Path error: node not found" unless node
|
41
41
|
|
42
42
|
result = nil
|
43
|
-
@success << [nil, path_no]
|
43
|
+
@success << [nil, path_no.to_i]
|
44
44
|
|
45
45
|
begin
|
46
46
|
result = yield(*%w(input output).map {|x| Select.new(x,node)})
|
@@ -70,6 +70,12 @@ class Testdata
|
|
70
70
|
|
71
71
|
def passed?() @success.map(&:first).all? end
|
72
72
|
def score() success = @success.map(&:first); [success.grep(true), success].map(&:length).join('/') end
|
73
|
+
def summary()
|
74
|
+
a = @success.map(&:last).sort
|
75
|
+
{false: @success.select{|x| x[0] == false}.map(&:last).sort,
|
76
|
+
nil: ((a[0]..a[-1]).to_a - a)}
|
77
|
+
end
|
78
|
+
|
73
79
|
def find_by(s)
|
74
80
|
XPath.match(@doc.root, "records/test/summary[type='#{s}']/description/text()").map(&:to_s)
|
75
81
|
end
|