testdata 0.2.4 → 0.2.5

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 +3 -2
  2. metadata +1 -1
data/lib/testdata.rb CHANGED
@@ -40,13 +40,14 @@ class Path
40
40
  raise "Path error: node not found" unless node
41
41
 
42
42
  result = nil
43
+ @success << [nil, path_no]
43
44
 
44
45
  begin
45
46
  result = yield(*%w(input output).map {|x| Select.new(x,node)})
46
47
  rescue
47
48
  result = false
48
49
  ensure
49
- @success << [result, path_no]
50
+ @success[-1][0] = result
50
51
  end
51
52
  end
52
53
  end
@@ -68,7 +69,7 @@ class Testdata
68
69
  def read_url(xml_url) open(xml_url, 'UserAgent' => 'S-Rscript').read end
69
70
 
70
71
  def passed?() @success.map(&:first).all? end
71
- def score() success = @success.map(&:first); [@success.grep(true), @success].map(&:length).join('/') end
72
+ def score() success = @success.map(&:first); [success.grep(true), success].map(&:length).join('/') end
72
73
  def find_by(s)
73
74
  XPath.match(@doc.root, "records/test/summary[type='#{s}']/description/text()").map(&:to_s)
74
75
  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.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors: []
7
7