spectus 2.6.0 → 2.7.0
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/VERSION.semver +1 -1
- data/lib/spectus/result/fail.rb +23 -2
- data/lib/spectus/result/pass.rb +23 -2
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e8bffe1e596be35406a96048362f2185a3fe86
|
4
|
+
data.tar.gz: 320c01e58778271f1e33429008b0a3624c6fc887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d5fee8bcf43d9a9880737acc118663c7f319fae9fc00dc74eddfa9918a0c2c1bceebcc78b577e8a4a99e31dd40046189a260d3ef6a6a3b5422b77c4b0b2d7ef
|
7
|
+
data.tar.gz: f73dd58bb00aa33e7896fb8dba220ba5005388dfadbe7a0159c853482e3ef44f09d2941ce2849f0b5d6772cdf4034c95b85abc1b6e922049cf2cf63735ec2c2b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.0
|
data/lib/spectus/result/fail.rb
CHANGED
@@ -13,13 +13,34 @@ module Spectus
|
|
13
13
|
false
|
14
14
|
end
|
15
15
|
|
16
|
+
# The state of failure.
|
17
|
+
#
|
18
|
+
# @return [Boolean] The test was a failure.
|
19
|
+
def failure?
|
20
|
+
error.nil?
|
21
|
+
end
|
22
|
+
|
23
|
+
# The state of error.
|
24
|
+
#
|
25
|
+
# @return [Boolean] The test was an error.
|
26
|
+
def error?
|
27
|
+
!failure?
|
28
|
+
end
|
29
|
+
|
16
30
|
# Identify the state of the result.
|
17
31
|
#
|
32
|
+
# @return [Symbol] The identifier of the state.
|
33
|
+
def to_sym
|
34
|
+
failure? ? :failure : :error
|
35
|
+
end
|
36
|
+
|
37
|
+
# Express the result with one char.
|
38
|
+
#
|
18
39
|
# @param color [Boolean] Enable the color.
|
19
40
|
#
|
20
|
-
# @return [String] The char that identify the
|
41
|
+
# @return [String] The char that identify the result.
|
21
42
|
def to_char(color = false)
|
22
|
-
if
|
43
|
+
if failure?
|
23
44
|
color ? "\e[35mF\e[0m" : 'F'
|
24
45
|
else
|
25
46
|
color ? "\e[31mE\e[0m" : 'E'
|
data/lib/spectus/result/pass.rb
CHANGED
@@ -18,13 +18,34 @@ module Spectus
|
|
18
18
|
true
|
19
19
|
end
|
20
20
|
|
21
|
+
# The state of success.
|
22
|
+
#
|
23
|
+
# @return [Boolean] The test was a success.
|
24
|
+
def success?
|
25
|
+
got.equal?(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
# The state of info.
|
29
|
+
#
|
30
|
+
# @return [Boolean] The test was an info.
|
31
|
+
def info?
|
32
|
+
!success?
|
33
|
+
end
|
34
|
+
|
21
35
|
# Identify the state of the result.
|
22
36
|
#
|
37
|
+
# @return [Symbol] The identifier of the state.
|
38
|
+
def to_sym
|
39
|
+
success? ? :success : :info
|
40
|
+
end
|
41
|
+
|
42
|
+
# Express the result with one char.
|
43
|
+
#
|
23
44
|
# @param color [Boolean] Enable the color.
|
24
45
|
#
|
25
|
-
# @return [String] The char that identify the
|
46
|
+
# @return [String] The char that identify the result.
|
26
47
|
def to_char(color = false)
|
27
|
-
if
|
48
|
+
if success?
|
28
49
|
color ? "\e[32m.\e[0m" : '.'
|
29
50
|
else
|
30
51
|
color ? "\e[33mI\e[0m" : 'I'
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|