testdata 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/testdata.rb +5 -4
- metadata +2 -2
data/lib/testdata.rb
CHANGED
@@ -36,11 +36,12 @@ class Path
|
|
36
36
|
|
37
37
|
def tested? description
|
38
38
|
node = XPath.first(@doc.root, "records/test[summary/description='#{description}']")
|
39
|
+
path_no = node.text('summary/path')
|
39
40
|
raise "Path error: node not found" unless node
|
40
41
|
begin
|
41
|
-
@success << yield(*%w(input output).map {|x| Select.new(x,node)})
|
42
|
+
@success << [yield(*%w(input output).map {|x| Select.new(x,node)}), path_no]
|
42
43
|
rescue
|
43
|
-
@success << false
|
44
|
+
@success << [false, path_no]
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
@@ -61,8 +62,8 @@ class Testdata
|
|
61
62
|
def read_file(s) File.open(s, 'r').read end
|
62
63
|
def read_url(xml_url) open(xml_url, 'UserAgent' => 'S-Rscript').read end
|
63
64
|
|
64
|
-
def passed?() @success.all? end
|
65
|
-
def score() [@success.grep(true), @success].map(&:length).join('/') end
|
65
|
+
def passed?() @success.map(&:first).all? end
|
66
|
+
def score() success = @success.map(&:first); [@success.grep(true), @success].map(&:length).join('/') end
|
66
67
|
def find_by(s)
|
67
68
|
XPath.match(@doc.root, "records/test/summary[type='#{s}']/description/text()").map(&:to_s)
|
68
69
|
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
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-11-18 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|