class Assertion

Public Class Methods

new(message=nil, options={}) click to toggle source

New assertion (failure).

@param message [String] the failure message @param options [Hash] options such as :backtrace

Calls superclass method
# File lib/rubytest/core_ext/assertion.rb, line 8
def initialize(message=nil, options={})
  super(message)
  backtrace = options[:backtrace]
  set_backtrace(backtrace) if backtrace
  @assertion = true
end

Public Instance Methods

assertion?() click to toggle source

Technically any object that affirmatively responds to assertion? can be taken to be an Assertion. This makes it easier for various libraries to work together without having to depend upon a common Assertion base class.

# File lib/rubytest/core_ext/assertion.rb, line 19
def assertion?
  true # @assertion
end
to_s() click to toggle source

Parents error message prefixed with “(assertion)”.

@return [String] error message

Calls superclass method
# File lib/rubytest/core_ext/assertion.rb, line 26
def to_s
  '(assertion) ' + super
end