Class: Jasmine::Result
- Inherits:
-
Object
- Object
- Jasmine::Result
- Defined in:
- lib/jasmine/result.rb
Defined Under Namespace
Classes: Failure
Instance Attribute Summary collapse
-
#deprecation_warnings ⇒ Object
readonly
Returns the value of attribute deprecation_warnings.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#failed_expectations ⇒ Object
readonly
Returns the value of attribute failed_expectations.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#pending_reason ⇒ Object
readonly
Returns the value of attribute pending_reason.
-
#suite_name ⇒ Object
readonly
Returns the value of attribute suite_name.
Class Method Summary collapse
Instance Method Summary collapse
- #disabled? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(attrs) ⇒ Result
constructor
A new instance of Result.
- #pending? ⇒ Boolean
- #succeeded? ⇒ Boolean
Constructor Details
#initialize(attrs) ⇒ Result
Returns a new instance of Result.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/jasmine/result.rb', line 8 def initialize(attrs) @show_full_stack_trace = attrs["show_full_stack_trace"] @status = attrs["status"] @full_name = attrs["fullName"] @description = attrs["description"] @failed_expectations = map_failures(attrs.fetch("failedExpectations", [])) @deprecation_warnings = map_failures(attrs.fetch("deprecationWarnings", [])) @suite_name = full_name.slice(0, full_name.size - description.size - 1) @pending_reason = attrs["pendingReason"] end |
Instance Attribute Details
#deprecation_warnings ⇒ Object (readonly)
Returns the value of attribute deprecation_warnings.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def deprecation_warnings @deprecation_warnings end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def description @description end |
#failed_expectations ⇒ Object (readonly)
Returns the value of attribute failed_expectations.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def failed_expectations @failed_expectations end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def full_name @full_name end |
#pending_reason ⇒ Object (readonly)
Returns the value of attribute pending_reason.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def pending_reason @pending_reason end |
#suite_name ⇒ Object (readonly)
Returns the value of attribute suite_name.
35 36 37 |
# File 'lib/jasmine/result.rb', line 35 def suite_name @suite_name end |
Class Method Details
.map_raw_results(raw_results) ⇒ Object
4 5 6 |
# File 'lib/jasmine/result.rb', line 4 def self.map_raw_results(raw_results) raw_results.map { |r| new(r) } end |
Instance Method Details
#disabled? ⇒ Boolean
31 32 33 |
# File 'lib/jasmine/result.rb', line 31 def disabled? status == 'disabled' end |
#failed? ⇒ Boolean
23 24 25 |
# File 'lib/jasmine/result.rb', line 23 def failed? status == 'failed' end |
#pending? ⇒ Boolean
27 28 29 |
# File 'lib/jasmine/result.rb', line 27 def pending? status == 'pending' end |
#succeeded? ⇒ Boolean
19 20 21 |
# File 'lib/jasmine/result.rb', line 19 def succeeded? status == 'passed' end |