Class: ArchUnit::Testing::TestResult
- Inherits:
-
Data
- Object
- Data
- ArchUnit::Testing::TestResult
- Defined in:
- lib/archunit/testing/test_result.rb
Overview
Immutable framework-neutral pass flag and formatted message.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#passed ⇒ Object
readonly
Returns the value of attribute passed.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(passed:, message:) ⇒ TestResult
constructor
A new instance of TestResult.
- #passed? ⇒ Boolean
Constructor Details
#initialize(passed:, message:) ⇒ TestResult
Returns a new instance of TestResult.
8 9 10 11 12 13 14 15 |
# File 'lib/archunit/testing/test_result.rb', line 8 def initialize(passed:, message:) raise ArgumentError, 'passed must be true or false' unless [true, false].include?(passed) unless .is_a?(String) && !.empty? raise ArgumentError, 'message must be a non-empty String' end super(passed:, message: .dup.freeze) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message
7 8 9 |
# File 'lib/archunit/testing/test_result.rb', line 7 def @message end |
#passed ⇒ Object (readonly)
Returns the value of attribute passed
7 8 9 |
# File 'lib/archunit/testing/test_result.rb', line 7 def passed @passed end |
Instance Method Details
#failed? ⇒ Boolean
21 22 23 |
# File 'lib/archunit/testing/test_result.rb', line 21 def failed? !passed end |
#passed? ⇒ Boolean
17 18 19 |
# File 'lib/archunit/testing/test_result.rb', line 17 def passed? passed end |