Class: RSpec::Core::Example::ExecutionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/example.rb

Overview

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Exception?) exception



401
402
403
# File 'lib/rspec/core/example.rb', line 401

def exception
  @exception
end

- (Time) finished_at



407
408
409
# File 'lib/rspec/core/example.rb', line 407

def finished_at
  @finished_at
end

- (Exception?) pending_exception



420
421
422
# File 'lib/rspec/core/example.rb', line 420

def pending_exception
  @pending_exception
end

- (Boolean) pending_fixed Also known as: pending_fixed?



424
425
426
# File 'lib/rspec/core/example.rb', line 424

def pending_fixed
  @pending_fixed
end

- (String?) pending_message



414
415
416
# File 'lib/rspec/core/example.rb', line 414

def pending_message
  @pending_message
end

- (Float) run_time



410
411
412
# File 'lib/rspec/core/example.rb', line 410

def run_time
  @run_time
end

- (Time) started_at



404
405
406
# File 'lib/rspec/core/example.rb', line 404

def started_at
  @started_at
end

- (Symbol) status



398
399
400
# File 'lib/rspec/core/example.rb', line 398

def status
  @status
end

Instance Method Details

- (void) record_finished(status, finished_at)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Records the finished status of the example.



430
431
432
433
434
# File 'lib/rspec/core/example.rb', line 430

def record_finished(status, finished_at)
  self.status      = status
  self.finished_at = finished_at
  self.run_time    = (finished_at - started_at).to_f
end