testdata 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/testdata.rb +7 -1
  2. 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
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: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors: []
7
7