fix 0.12.1 → 0.12.2
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/README.md +1 -1
- data/VERSION.semver +1 -1
- data/checksum/fix-0.12.1.gem.sha512 +1 -0
- data/lib/fix.rb +1 -1
- data/lib/fix/report.rb +58 -30
- metadata +3 -3
- metadata.gz.sig +0 -0
- data/.rubocop.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45838ef872d6a29fda7dd506bdc57195f51bbb40
|
4
|
+
data.tar.gz: 7f2df30fee8f7edc98e46b1273b0bc1296753664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caddf82391e49d19941a2f839d94137479124ba37876ae75aa20d3038fc3ae003f8a46381adce353c4b7fda7bd97cd47bbca81be70166518cbba77c6ef6be8fc
|
7
|
+
data.tar.gz: 234696627df5367230d8d20b874e76af040ed9cdf6c2a70403ee7942019d391df81884e3f7e413446b72eb191c171956d10adbe7509e7724e9199b1d72b9fe49
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -49,7 +49,7 @@ And then execute:
|
|
49
49
|
|
50
50
|
### Minimalist
|
51
51
|
|
52
|
-
With
|
52
|
+
With 179 lines of **simple code** built on top of [Spectus expectation library](https://github.com/fixrb/spectus), facilities such as benchmarking and mocking are not supported. __Fix__ offers however a **consistent** syntax to focus your BDD.
|
53
53
|
|
54
54
|
### Resistant
|
55
55
|
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.2
|
@@ -0,0 +1 @@
|
|
1
|
+
3867c77b30709a95156d9910e5be5e87ebdfa2d535c46d776aa0be149e398b660654544d478cdb8353d2ae77c5b258e9db3ef17e7b9326b56d5e5880b7be654b
|
data/lib/fix.rb
CHANGED
data/lib/fix/report.rb
CHANGED
@@ -13,17 +13,14 @@ module Fix
|
|
13
13
|
|
14
14
|
# @!attribute [r] test
|
15
15
|
#
|
16
|
-
# @return [Test] The
|
16
|
+
# @return [Test] The results of the test.
|
17
17
|
attr_reader :test
|
18
18
|
|
19
19
|
# The report in plain text.
|
20
20
|
#
|
21
21
|
# @return [String] The report in plain text.
|
22
22
|
def to_s
|
23
|
-
maybe_thematic_break +
|
24
|
-
maybe_alerts_banner +
|
25
|
-
total_time_banner +
|
26
|
-
statistics_banner
|
23
|
+
maybe_thematic_break + maybe_alerts + total_time + statistics
|
27
24
|
end
|
28
25
|
|
29
26
|
private
|
@@ -34,7 +31,7 @@ module Fix
|
|
34
31
|
end
|
35
32
|
|
36
33
|
# @private
|
37
|
-
def
|
34
|
+
def total_time
|
38
35
|
"Ran #{test.results.length} tests in #{test.total_time} seconds\n"
|
39
36
|
end
|
40
37
|
|
@@ -44,24 +41,27 @@ module Fix
|
|
44
41
|
end
|
45
42
|
|
46
43
|
# @private
|
47
|
-
def
|
48
|
-
alerts.any? ? "#{
|
44
|
+
def maybe_alerts
|
45
|
+
alerts.any? ? "#{results.join("\n")}\n" : ''
|
49
46
|
end
|
50
47
|
|
51
48
|
# @private
|
52
|
-
def
|
49
|
+
def results
|
53
50
|
alerts.map.with_index(1) do |r, i|
|
54
|
-
|
51
|
+
maybe_results_color("#{i}. #{r.message}\n" + maybe_backtrace(r), r)
|
52
|
+
end
|
53
|
+
end
|
55
54
|
|
56
|
-
|
55
|
+
# @private
|
56
|
+
def maybe_results_color(string, result)
|
57
|
+
return string unless @test.configuration.fetch(:color)
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
end
|
59
|
+
if result.to_sym.equal?(:info)
|
60
|
+
"\e[#{info_color}m#{string}\e[0m"
|
61
|
+
elsif result.to_sym.equal?(:failure)
|
62
|
+
"\e[#{failure_color}m#{string}\e[0m"
|
63
|
+
else
|
64
|
+
"\e[#{error_color}m#{string}\e[0m"
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -71,25 +71,53 @@ module Fix
|
|
71
71
|
end
|
72
72
|
|
73
73
|
# @private
|
74
|
-
def
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
74
|
+
def statistics
|
75
|
+
if @test.configuration.fetch(:color)
|
76
|
+
statistics_color(statistics_text, test.statistics)
|
77
|
+
else
|
78
|
+
statistics_text
|
79
|
+
end
|
80
|
+
end
|
81
81
|
|
82
|
-
|
82
|
+
# @private
|
83
|
+
def statistics_text
|
84
|
+
"#{test.statistics.fetch(:pass_percent)}% compliant - " \
|
85
|
+
"#{test.statistics.fetch(:total_infos)} infos, " \
|
86
|
+
"#{test.statistics.fetch(:total_failures)} failures, " \
|
87
|
+
"#{test.statistics.fetch(:total_errors)} errors\n"
|
88
|
+
end
|
83
89
|
|
90
|
+
# @private
|
91
|
+
def statistics_color(string, stats)
|
84
92
|
if stats.fetch(:total_errors) > 0
|
85
|
-
"\e[
|
93
|
+
"\e[#{error_color}m#{string}\e[0m"
|
86
94
|
elsif stats.fetch(:total_failures) > 0
|
87
|
-
"\e[
|
95
|
+
"\e[#{failure_color}m#{string}\e[0m"
|
88
96
|
elsif stats.fetch(:total_infos) > 0
|
89
|
-
"\e[
|
97
|
+
"\e[#{info_color}m#{string}\e[0m"
|
90
98
|
else
|
91
|
-
"\e[
|
99
|
+
"\e[#{success_color}m#{string}\e[0m"
|
92
100
|
end
|
93
101
|
end
|
102
|
+
|
103
|
+
# @private
|
104
|
+
def error_color
|
105
|
+
31
|
106
|
+
end
|
107
|
+
|
108
|
+
# @private
|
109
|
+
def failure_color
|
110
|
+
35
|
111
|
+
end
|
112
|
+
|
113
|
+
# @private
|
114
|
+
def info_color
|
115
|
+
33
|
116
|
+
end
|
117
|
+
|
118
|
+
# @private
|
119
|
+
def success_color
|
120
|
+
32
|
121
|
+
end
|
94
122
|
end
|
95
123
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
31
31
|
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-09-
|
33
|
+
date: 2015-09-20 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: defi
|
@@ -138,7 +138,6 @@ extensions: []
|
|
138
138
|
extra_rdoc_files: []
|
139
139
|
files:
|
140
140
|
- ".gitignore"
|
141
|
-
- ".rubocop.yml"
|
142
141
|
- ".travis.yml"
|
143
142
|
- ".yardopts"
|
144
143
|
- CODE_OF_CONDUCT.md
|
@@ -157,6 +156,7 @@ files:
|
|
157
156
|
- checksum/fix-0.11.0.gem.sha512
|
158
157
|
- checksum/fix-0.11.1.gem.sha512
|
159
158
|
- checksum/fix-0.12.0.gem.sha512
|
159
|
+
- checksum/fix-0.12.1.gem.sha512
|
160
160
|
- checksum/fix-0.2.0.gem.sha512
|
161
161
|
- checksum/fix-0.3.0.gem.sha512
|
162
162
|
- checksum/fix-0.4.0.gem.sha512
|
metadata.gz.sig
CHANGED
Binary file
|