testdata 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/testdata.rb +22 -7
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32849b0ae198aae1f9d452d43546af0b38a536a1020244a1c665e57849f2a737
|
4
|
+
data.tar.gz: d36e7b2b424dba8d996e340ec339efc5d2994ce50d19b5b2597d2c257617a7c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afd9e441d73dc0c4a46e46d85a19eb9e48c41d9660a20c0526ea9526c510d86657542bd2949aa0fa499ef73706935127e67108ac72c0f13063d0972fe1e0b78
|
7
|
+
data.tar.gz: eae8ad80bd813f4c18b61062ac7c406a32f5f3fd0258ebd6cc1f6cdb4f7f126032cb55e01f602333a7602ee1aab74ba14c29b37f7839d9af4cd40393bc3ac5fb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/testdata.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require 'app-routes'
|
6
6
|
require 'testdata_text'
|
7
|
-
require '
|
7
|
+
require 'diffyc32'
|
8
8
|
require 'polyrex'
|
9
9
|
require 'yaml'
|
10
10
|
|
@@ -15,6 +15,7 @@ end
|
|
15
15
|
module Testdata
|
16
16
|
|
17
17
|
class Base
|
18
|
+
using ColouredText
|
18
19
|
|
19
20
|
include AppRoutes
|
20
21
|
|
@@ -167,10 +168,10 @@ module Testdata
|
|
167
168
|
inputs = input_names.zip(inputs).map{|x| ' ' + x.join(": ")}\
|
168
169
|
.join("\n")
|
169
170
|
|
170
|
-
puts "\ninputs: \n" + inputs
|
171
|
-
puts "\ntype or description
|
172
|
-
puts "\nexpected : \n " + b.inspect
|
173
|
-
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"
|
174
175
|
end
|
175
176
|
|
176
177
|
result = a == b
|
@@ -178,7 +179,13 @@ module Testdata
|
|
178
179
|
if (@debug == true or @debug2 == true) and result == false then
|
179
180
|
|
180
181
|
# diff the expected and actual valuess
|
181
|
-
|
182
|
+
r = Diffy::Diff.new(a.first, b.first).to_s
|
183
|
+
r2 = r.lines.map do |line|
|
184
|
+
line.sub(/^\- {4}/) {|x| "- ".light_green}\
|
185
|
+
.sub(/^\+ {4}/) {|x| "+ ".light_red}
|
186
|
+
end
|
187
|
+
#puts 'r: ' + r.lines.inspect
|
188
|
+
puts r2
|
182
189
|
end
|
183
190
|
else
|
184
191
|
result = [raw_actual].compact == expected
|
@@ -277,11 +284,19 @@ module Testdata
|
|
277
284
|
def summary()
|
278
285
|
success = @success.map(&:first)
|
279
286
|
a = @success.map(&:last).sort
|
280
|
-
{
|
287
|
+
h = {
|
281
288
|
passed: success.all?,
|
282
289
|
score: [success.grep(true), success].map(&:length).join('/'),
|
283
290
|
failed: @success.select{|x| x[0] == false}.map(&:last).sort
|
284
291
|
}
|
292
|
+
|
293
|
+
def h.to_s()
|
294
|
+
passed = self[:passed] ? self[:passed].to_s.light_green : self[:passed].to_s.light_red
|
295
|
+
"{passed: #{passed}, score: #{self[:score]}, failed: #{self[:failed]}}"
|
296
|
+
|
297
|
+
end
|
298
|
+
|
299
|
+
h
|
285
300
|
end
|
286
301
|
end
|
287
302
|
|
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.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
U1Tt/KPr9FeWlvj5ihis4H6UPWZxY2G9k94y2W7ylWkcKNXR8i45F+nCzDL3W0Ll
|
36
36
|
Vt/9GDfEI95Jg3QNvXMDdzNf
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-09-
|
38
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: app-routes
|
@@ -78,25 +78,25 @@ dependencies:
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0.2'
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
81
|
+
name: diffyc32
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
86
|
+
version: 0.1.0
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0.1'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.1.0
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
99
|
+
version: '0.1'
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: polyrex
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|