Class: Spectus::Result::Pass Private
- Inherits:
-
Object
- Object
- Spectus::Result::Pass
- Includes:
- Base
- Defined in:
- lib/spectus/result/pass.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The class that is responsible for reporting that the expectation is true.
Instance Attribute Summary collapse
-
#message ⇒ String
readonly
private
The message that describe the state.
Attributes included from Base
#actual, #challenge, #error, #expected, #got, #level, #subject
Instance Method Summary collapse
-
#info? ⇒ Boolean
private
The state of info.
-
#result? ⇒ Boolean
private
The value of the expectation of the spec.
-
#success? ⇒ Boolean
private
The state of success.
-
#to_char(color = false) ⇒ String
private
Express the result with one char.
-
#to_sym ⇒ Symbol
private
Identify the state of the result.
Methods included from Base
#initialize, #negate?, #to_h, #valid?
Instance Attribute Details
#message ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The message that describe the state.
14 15 16 |
# File 'lib/spectus/result/pass.rb', line 14 def @message end |
Instance Method Details
#info? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The state of info.
33 34 35 |
# File 'lib/spectus/result/pass.rb', line 33 def info? !success? end |
#result? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The value of the expectation of the spec.
19 20 21 |
# File 'lib/spectus/result/pass.rb', line 19 def result? true end |
#success? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The state of success.
26 27 28 |
# File 'lib/spectus/result/pass.rb', line 26 def success? got.equal?(true) end |
#to_char(color = false) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Express the result with one char.
49 50 51 52 53 54 55 |
# File 'lib/spectus/result/pass.rb', line 49 def to_char(color = false) if success? color ? "\e[32m.\e[0m" : '.' else color ? "\e[33mI\e[0m" : 'I' end end |
#to_sym ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Identify the state of the result.
40 41 42 |
# File 'lib/spectus/result/pass.rb', line 40 def to_sym success? ? :success : :info end |