testdata 1.1.5 → 1.1.10

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
- SHA1:
3
- metadata.gz: 95b6854c691c440acdad880ea07c8a52fda48448
4
- data.tar.gz: a390493e3c6f7fa9ff01a491adfc6d02d9ca90ad
2
+ SHA256:
3
+ metadata.gz: 538ee4e9da6112785d2a5adb42574122aac61b61132b737b8a514acaad5978e9
4
+ data.tar.gz: 335a22cee75aa3760bd10dbf3bb3d814aafbe320f0bd4f7f1b721136743b26d6
5
5
  SHA512:
6
- metadata.gz: 21da46a1e3736b6bdf3d2642273b2eb9a2f8a66e98e0f30a5bace5f725c5b8439930391209e1b401799c762380d923a197de8909a20368796f3915fea8378b3e
7
- data.tar.gz: 65d32f82fb007325a15009129201416737cb1bee11456eb852b8c4c7233303546fc8f616061fc3fd81d2fa1865fea22d3ea442c29a25677785f88e12f9b91c7b
6
+ metadata.gz: 5b4ead3de090642fc503b1d1a076e2632678962adf4f3a0f0e972c7b33c10965f4de040c1d9c65cf3ae54a0e194c7f557cd9a27dada6d069744f1ea6956469d4
7
+ data.tar.gz: e6784581fdfcfe104897f800d1866ed10375cc9425408a20d7eed146ea1775a301a558a803b229b267c5fc689367dc3ad9fe6c198a04fd5f90fa462bf462727f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,8 +4,9 @@
4
4
 
5
5
  require 'app-routes'
6
6
  require 'testdata_text'
7
- require 'diffy'
7
+ require 'diffyc32'
8
8
  require 'polyrex'
9
+ require 'yaml'
9
10
 
10
11
 
11
12
  class TestdataException < Exception
@@ -14,6 +15,7 @@ end
14
15
  module Testdata
15
16
 
16
17
  class Base
18
+ using ColouredText
17
19
 
18
20
  include AppRoutes
19
21
 
@@ -54,6 +56,15 @@ module Testdata
54
56
 
55
57
  def run(raw_x=nil, debug2=nil)
56
58
 
59
+ # verify the document has unique path numbers
60
+
61
+ a = @doc.root.xpath('records/test/summary/path/text()')
62
+ duplicates = a.select{ |e| a.count(e) > 1 }.uniq
63
+
64
+ if duplicates.any? then
65
+ raise 'Duplicate path found. Path: ' + duplicates.inspect
66
+ end
67
+
57
68
  @debug2 = debug2 ? true : false
58
69
  @success = []
59
70
 
@@ -63,7 +74,7 @@ module Testdata
63
74
  else
64
75
  raw_x
65
76
  end
66
-
77
+
67
78
  procs = {NilClass: :test_all, Range: :test_range, String: :test_id,
68
79
  Integer: :test_id, Fixnum: :test_id}
69
80
 
@@ -108,12 +119,25 @@ module Testdata
108
119
  x ||=(0..-1)
109
120
 
110
121
  break_on_fail = @doc.root.element('summary/break_on_fail/text()') == 'true'
122
+
123
+ test_id = nil
111
124
 
112
- @doc.root.xpath("records/test/summary/path/text()")[x].each do |id|
125
+ begin
126
+
127
+ @doc.root.xpath("records/test/summary/path/text()")[x].each do |id|
128
+
129
+ test_id = id
130
+ puts 'testing id: ' + id.inspect
131
+ result = test_id(id)
132
+ break if result == false and break_on_fail
133
+
134
+ end
135
+
136
+ rescue
113
137
 
114
- result = test_id(id)
115
- break if result == false and break_on_fail
138
+ @success << [false, test_id.to_i]
116
139
  end
140
+
117
141
 
118
142
  end
119
143
 
@@ -144,18 +168,20 @@ module Testdata
144
168
  inputs = input_names.zip(inputs).map{|x| ' ' + x.join(": ")}\
145
169
  .join("\n")
146
170
 
147
- puts "\ninputs: \n" + inputs
148
- puts "\ntype or description:\n %s: %s" % [type, @desc]
149
- puts "\nexpected : \n " + b.inspect
150
- puts "\nactual : \n " + a.inspect + "\n"
171
+ puts "\ninputs: \n".bold + inputs
172
+ puts "\ntype or description:".bold + "\n %s %s".cyan % [type, @desc]
173
+ puts "\nexpected : \n ".bold + b.inspect
174
+ puts "\nactual : \n ".bold + a.inspect + "\n"
151
175
  end
152
176
 
153
- result = a == b
177
+ result = a.join.force_encoding("UTF-8") == \
178
+ b.join.force_encoding("UTF-8")
154
179
 
155
180
  if (@debug == true or @debug2 == true) and result == false then
156
181
 
157
182
  # diff the expected and actual valuess
158
- puts Diffy::Diff.new(a.first, b.first)
183
+ puts DiffyC32.new(b.first, a.first).to_s
184
+
159
185
  end
160
186
  else
161
187
  result = [raw_actual].compact == expected
@@ -182,7 +208,7 @@ module Testdata
182
208
  end
183
209
 
184
210
  def read_rdx(buffer)
185
-
211
+ puts 'inside read_rdf: buffer: ' + buffer.inspect
186
212
  dx = Dynarex.new
187
213
  dx.import buffer
188
214
 
@@ -242,6 +268,7 @@ module Testdata
242
268
  end
243
269
 
244
270
  def read_td(buffer)
271
+ puts 'buffer: ' + buffer
245
272
  TestdataText.parse buffer
246
273
  end
247
274
 
@@ -253,11 +280,19 @@ module Testdata
253
280
  def summary()
254
281
  success = @success.map(&:first)
255
282
  a = @success.map(&:last).sort
256
- {
283
+ h = {
257
284
  passed: success.all?,
258
285
  score: [success.grep(true), success].map(&:length).join('/'),
259
286
  failed: @success.select{|x| x[0] == false}.map(&:last).sort
260
287
  }
288
+
289
+ def h.to_s()
290
+ passed = self[:passed] ? self[:passed].to_s.light_green : self[:passed].to_s.light_red
291
+ "{passed: #{passed}, score: #{self[:score]}, failed: #{self[:failed]}}"
292
+
293
+ end
294
+
295
+ h
261
296
  end
262
297
  end
263
298
 
@@ -319,4 +354,4 @@ end
319
354
 
320
355
  end
321
356
  end
322
- end
357
+ 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: 1.1.5
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,28 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgm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tbWFzdGVyQGphbWVzcm9iZXJ0
27
+ c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
28
+ BgkqhkiG9w0BAQsFAAOCAYEATciFgyRCUKVEJFrO291gbPIEAkeCsLtCRxB0Qz7R
29
+ Z/7bcVTdrk8/S2VQupuuni8UGeIQuxMTIkoWshCztNrIJ77xxdvk6/WqKqyxeRyZ
30
+ WKp6dPBvK0CXPRnboicdgWyiJZFr8WXGHmJuRG+SIhMPjR552kTpoKuUqf/aMs0q
31
+ krS/PjRP7MX2lCx2ZYi6/CdwyJmI5tO4ffXBNFpfquiwAa/tzPKKpbzEFjuUdTs0
32
+ ByW7I/n/h2fQkhR+/hbzh/xzCuRatkvUkAHmtW1StGSbPn0Hoam6hwWp+NuuUfEU
33
+ tA2AMgGW5/Ft/vBLFyCfMr/9x6QJEW3VtfwqL8zie4jp2sVCrW1gdotA3+4XdaEF
34
+ fUI/y8o+W/4oN7aCyhUzCXTSlGzwEHLqqCYX3DFerUd+mdQhSNLYAQuJtj/4zoNc
35
+ U1Tt/KPr9FeWlvj5ihis4H6UPWZxY2G9k94y2W7ylWkcKNXR8i45F+nCzDL3W0Ll
36
+ Vt/9GDfEI95Jg3QNvXMDdzNf
33
37
  -----END CERTIFICATE-----
34
- date: 2017-09-07 00:00:00.000000000 Z
38
+ date: 2020-09-18 00:00:00.000000000 Z
35
39
  dependencies:
36
40
  - !ruby/object:Gem::Dependency
37
41
  name: app-routes
@@ -62,7 +66,7 @@ dependencies:
62
66
  version: '0.2'
63
67
  - - ">="
64
68
  - !ruby/object:Gem::Version
65
- version: 0.2.0
69
+ version: 0.2.2
66
70
  type: :runtime
67
71
  prerelease: false
68
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -72,47 +76,47 @@ dependencies:
72
76
  version: '0.2'
73
77
  - - ">="
74
78
  - !ruby/object:Gem::Version
75
- version: 0.2.0
79
+ version: 0.2.2
76
80
  - !ruby/object:Gem::Dependency
77
- name: diffy
81
+ name: diffyc32
78
82
  requirement: !ruby/object:Gem::Requirement
79
83
  requirements:
80
84
  - - "~>"
81
85
  - !ruby/object:Gem::Version
82
- version: '3.2'
86
+ version: '0.1'
83
87
  - - ">="
84
88
  - !ruby/object:Gem::Version
85
- version: 3.2.0
89
+ version: 0.1.1
86
90
  type: :runtime
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
93
  requirements:
90
94
  - - "~>"
91
95
  - !ruby/object:Gem::Version
92
- version: '3.2'
96
+ version: '0.1'
93
97
  - - ">="
94
98
  - !ruby/object:Gem::Version
95
- version: 3.2.0
99
+ version: 0.1.1
96
100
  - !ruby/object:Gem::Dependency
97
101
  name: polyrex
98
102
  requirement: !ruby/object:Gem::Requirement
99
103
  requirements:
100
104
  - - "~>"
101
105
  - !ruby/object:Gem::Version
102
- version: '1.1'
106
+ version: '1.3'
103
107
  - - ">="
104
108
  - !ruby/object:Gem::Version
105
- version: 1.1.12
109
+ version: 1.3.1
106
110
  type: :runtime
107
111
  prerelease: false
108
112
  version_requirements: !ruby/object:Gem::Requirement
109
113
  requirements:
110
114
  - - "~>"
111
115
  - !ruby/object:Gem::Version
112
- version: '1.1'
116
+ version: '1.3'
113
117
  - - ">="
114
118
  - !ruby/object:Gem::Version
115
- version: 1.1.12
119
+ version: 1.3.1
116
120
  description:
117
121
  email: james@jamesrobertson.eu
118
122
  executables: []
@@ -139,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
143
  - !ruby/object:Gem::Version
140
144
  version: '0'
141
145
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.6.8
146
+ rubygems_version: 3.0.3
144
147
  signing_key:
145
148
  specification_version: 4
146
149
  summary: A test framework which accepts test data in a Polyrex format.
metadata.gz.sig CHANGED
Binary file