testdata 0.8.11 → 0.8.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6145667ecd2aa92eb08103530d303160237f404f
4
- data.tar.gz: 9c55c92ce7498adee293ec5a94fcf2a60c5cc57e
3
+ metadata.gz: 85df418ee36fbf63d1251c05026d15f1dce0bd3d
4
+ data.tar.gz: 32271bb343c7bbec815b1544c2b6619cf84ff996
5
5
  SHA512:
6
- metadata.gz: 62e712a8cb605daffe324266565440ce38e7d1cfbc006f98f38cb7da9a629571a48930f9610e8615d1324b92c312994805686cd407ba6200686366ff938d697e
7
- data.tar.gz: b57e5005f2b2189f49c85317b26debca8e89579f59acaf9df46a4f97052ec5ceb9609355312a1c68beea4b24064f0849296cf16993b6d7075928bae4520c03cb
6
+ metadata.gz: 5f6029e4db3a86de52f62bb8b558c536e421b01a1259c26e5fbb04c9214083c85285a5cf012df827fe63b5c1c5f7a4263b8fffadf4858dff6b23113fa77aff61
7
+ data.tar.gz: c8455c98ebdb47410d1c7c42d83b07b01c98bab4259bb3e199125d26a87f650ffe01406dc998f6541fbd938b9b44fad3aceee9e96fafc39562f9d1c7a402ac8e
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/testdata.rb CHANGED
@@ -61,15 +61,14 @@ class Testdata
61
61
 
62
62
  input_names = input_nodes.map(&:name)
63
63
 
64
- # find the type or description
65
- xpath = "summary/type/text() | summary/description/text()"
66
- type_or_desc = XPath.match(node, xpath).map(&:to_s).find{|x| x != ''}
64
+ summary = XPath.first node, 'summary'
65
+ type, desc = summary.text('type'), summary.text('description')
67
66
 
68
67
  xpath = "records/io/summary[type='output']/*"
69
68
  raw_output = XPath.match(node, xpath)
70
69
  output_values = raw_output.length > 0 ? raw_output[1..-1].map(&stringify) : []
71
70
 
72
- [path_no, input_values, input_names, type_or_desc, output_values]
71
+ [path_no, input_values, input_names, type, output_values, desc]
73
72
  end
74
73
 
75
74
  def run(x=nil, debug2=nil)
@@ -95,11 +94,13 @@ class Testdata
95
94
 
96
95
  def test_id(id='')
97
96
 
98
- path_no, inputs, input_names, tod, expected = testdata_values(id.to_s)
99
-
97
+ path_no, inputs, input_names, type, expected, @desc =
98
+ testdata_values(id.to_s)
100
99
  @inputs = inputs
101
100
  tests() # load the routes
102
- raw_actual = run_route tod
101
+
102
+ raw_actual = run_route type
103
+ puts "warning: no test route found for " + type unless raw_actual
103
104
 
104
105
  result = nil
105
106
  @success << [nil, path_no.to_i]
@@ -117,7 +118,7 @@ class Testdata
117
118
  .join("\n")
118
119
 
119
120
  puts "\ninputs: \n" + inputs
120
- puts "\ntype or description:\n " + tod
121
+ puts "\ntype or description:\n %s: %s" % [type, @desc]
121
122
  puts "\nexpected : \n " + b.inspect
122
123
  puts "\nactual : \n " + a.inspect + "\n"
123
124
  end
@@ -163,8 +164,8 @@ class Testdata
163
164
 
164
165
 
165
166
  def test(s)
166
- @inputs = @inputs.first if @inputs.length == 1
167
- self.add_route(s){yield(@inputs)}
167
+ #@inputs = @inputs.first if @inputs.length == 1
168
+ self.add_route(s){yield(*(@inputs + [@desc]))}
168
169
  end
169
170
 
170
171
  def summary()
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.8.11
4
+ version: 0.8.12
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: 2014-03-14 00:00:00.000000000 Z
34
+ date: 2014-03-16 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