Class: TestResultFailure
- Inherits:
-
TestResult
- Object
- TestResult
- TestResultFailure
- Defined in:
- lib/perfecto-reporting/test/result/TestResultFailure.rb
Overview
TestResultFailure
Define a failure test result.
Constant Summary collapse
- @@STATUS =
'FAILED'
Instance Attribute Summary collapse
-
#failureReason ⇒ Object
Returns the value of attribute failureReason.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(reason, error, failureReason = nil) ⇒ TestResultFailure
constructor
Create a new instance.
- #isSuccessful ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(reason, error, failureReason = nil) ⇒ TestResultFailure
Create a new instance
reason - string representation of the failure reason error - exception caused to the failure failureReason - one of the failure reasons in the catalogue
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/perfecto-reporting/test/result/TestResultFailure.rb', line 17 def initialize(reason, error, failureReason=nil) if error.is_a? Exception @message = reason + '. Stack Trace:' + error.backtrace.to_s else @message = reason end ## Validate that the reason + error stacktrace are not longer then 4096 charcters if @message.length > 4096 @message = @message[0,4096] end @failureReason = failureReason end |
Instance Attribute Details
#failureReason ⇒ Object
Returns the value of attribute failureReason.
8 9 10 |
# File 'lib/perfecto-reporting/test/result/TestResultFailure.rb', line 8 def failureReason @failureReason end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/perfecto-reporting/test/result/TestResultFailure.rb', line 8 def @message end |
Instance Method Details
#isSuccessful ⇒ Object
31 32 33 |
# File 'lib/perfecto-reporting/test/result/TestResultFailure.rb', line 31 def isSuccessful return false end |
#status ⇒ Object
35 36 37 |
# File 'lib/perfecto-reporting/test/result/TestResultFailure.rb', line 35 def status @@STATUS end |