Class: RSpec::Core::Example::ExecutionResult
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | rspec-core/lib/rspec/core/example.rb |
Overview
Represents the result of executing an example. Behaves like a hash for backwards compatibility.
Instance Attribute Summary
Instance Method Summary
-
#ensure_timing_set(clock)
Internal use only
Internal use only
Populates finished_at and run_time if it has not yet been set.
-
#record_finished(status, finished_at)
Internal use only
Internal use only
Records the finished status of the example.
- #calculate_run_time(finished_at) private
- #get_value(name) private
-
#hash_for_delegation
private
For backwards compatibility we present #status as a string when presenting the legacy hash interface.
- #issue_deprecation(_method_name, *_args) private
- #set_value(name, value) private
::RSpec::Core::HashImitatable
- Included
Instance Attribute Details
#example_skipped? ⇒ Boolean
(readonly)
# File 'rspec-core/lib/rspec/core/example.rb', line 597
def example_skipped? status == :pending && !pending_exception end
#exception ⇒ Exception
? (rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 563
attr_accessor :exception
#finished_at ⇒ Time (rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 569
attr_accessor :finished_at
#pending_exception ⇒ Exception
? (rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 582
attr_accessor :pending_exception
#pending_fixed ⇒ Boolean
(rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 586
attr_accessor :pending_fixed
#pending_fixed? ⇒ Boolean
(rw)
[ GitHub ]
# File 'rspec-core/lib/rspec/core/example.rb', line 588
def pending_fixed? !!pending_fixed end
#pending_message ⇒ String
? (rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 576
attr_accessor :
#run_time ⇒ Float
(rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 572
attr_accessor :run_time
#started_at ⇒ Time (rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 566
attr_accessor :started_at
#status ⇒ Symbol
(rw)
# File 'rspec-core/lib/rspec/core/example.rb', line 560
attr_accessor :status
Instance Method Details
#calculate_run_time(finished_at) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/example.rb', line 616
def calculate_run_time(finished_at) self.finished_at = finished_at self.run_time = (finished_at - started_at).to_f end
#ensure_timing_set(clock)
This method is for internal use only.
Populates finished_at and run_time if it has not yet been set
# File 'rspec-core/lib/rspec/core/example.rb', line 610
def ensure_timing_set(clock) calculate_run_time(clock.now) unless finished_at end
#get_value(name) (private)
[ GitHub ]#hash_for_delegation (private)
For backwards compatibility we present #status as a string when presenting the legacy hash interface.
#issue_deprecation(_method_name, *_args) (private)
[ GitHub ]#record_finished(status, finished_at)
This method is for internal use only.
Records the finished status of the example.
# File 'rspec-core/lib/rspec/core/example.rb', line 603
def record_finished(status, finished_at) self.status = status calculate_run_time(finished_at) end
#set_value(name, value) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/example.rb', line 629
def set_value(name, value) value &&= value.to_sym if name == :status super(name, value) end