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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a3039a54e17899bf8152949c5254f2bb408fa8f
4
- data.tar.gz: 6ef7d675a023b8b09eecc7f3ea85a686911296b9
3
+ metadata.gz: c8e8bffe1e596be35406a96048362f2185a3fe86
4
+ data.tar.gz: 320c01e58778271f1e33429008b0a3624c6fc887
5
5
  SHA512:
6
- metadata.gz: 6a980d60f1deb2623454f5320bf831bc2609acff5af3d079ef568eaa331dbe4f76678ecc1cb493bd12c3c8cc1277ce5ec0e4181b3ad975cd74967dc7085c0335
7
- data.tar.gz: b0ae2542483c949b299ffce9f60fc4a5438311d717c35c36adcc31e2ec4dbf0c656d3a274c889db596ee1a67fe4ca23305ad33416422ecd25f3d634009a70c5a
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.6.0
1
+ 2.7.0
@@ -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 state of the result.
41
+ # @return [String] The char that identify the result.
21
42
  def to_char(color = false)
22
- if error.nil?
43
+ if failure?
23
44
  color ? "\e[35mF\e[0m" : 'F'
24
45
  else
25
46
  color ? "\e[31mE\e[0m" : 'E'
@@ -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 state of the result.
46
+ # @return [String] The char that identify the result.
26
47
  def to_char(color = false)
27
- if got
48
+ if success?
28
49
  color ? "\e[32m.\e[0m" : '.'
29
50
  else
30
51
  color ? "\e[33mI\e[0m" : 'I'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Wack
metadata.gz.sig CHANGED
Binary file