class RSpec::Core::Example::ExecutionResult

Represents the result of executing an example. Behaves like a hash for backwards compatibility.

Attributes

@return [Exception, nil] The failure, if there was one.

@return [Time] When the example finished.

@return [Exception, nil] The exception triggered while

executing the pending example. If no exception was triggered
it would no longer get a status of `:pending` unless it was
tagged with `:skip`.

@return [Boolean] For examples tagged with ‘:pending`,

this indicates whether or not it now passes.

@return [String, nil] The reason the example was pending,

or nil if the example was not pending.

@return [Float] How long the example took in seconds.

@return [Time] When the example started.

@return [Symbol] ‘:passed`, `:failed` or `:pending`.

Public Instance Methods

@api private 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

@return [Boolean] Indicates if the example was completely skipped

(typically done via `:skip` metadata or the `skip` method). Skipped examples
will have a `:pending` result. A `:pending` result can also come from examples
that were marked as `:pending`, which causes them to be run, and produces a
`:failed` result if the example passes.
# File rspec-core/lib/rspec/core/example.rb, line 597
def example_skipped?
  status == :pending && !pending_exception
end
# File rspec-core/lib/rspec/core/example.rb, line 588
def pending_fixed?
  !!pending_fixed
end

@api private 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