Exception: Test::Unit::AssertionFailedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/test/unit/assertion-failed-error.rb

Overview

Thrown by Test::Unit::Assertions when an assertion fails.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (AssertionFailedError) initialize(message = nil, options = nil)

Returns a new instance of AssertionFailedError



14
15
16
17
18
19
20
21
22
# File 'lib/test/unit/assertion-failed-error.rb', line 14

def initialize(message=nil, options=nil)
  options ||= {}
  @expected = options[:expected]
  @actual = options[:actual]
  @inspected_expected = options[:inspected_expected]
  @inspected_actual = options[:inspected_actual]
  @user_message = options[:user_message]
  super(message)
end

Instance Attribute Details

- (Object) actual

Returns the value of attribute actual



12
13
14
# File 'lib/test/unit/assertion-failed-error.rb', line 12

def actual
  @actual
end

- (Object) expected

Returns the value of attribute expected



12
13
14
# File 'lib/test/unit/assertion-failed-error.rb', line 12

def expected
  @expected
end

- (Object) inspected_actual

Returns the value of attribute inspected_actual



13
14
15
# File 'lib/test/unit/assertion-failed-error.rb', line 13

def inspected_actual
  @inspected_actual
end

- (Object) inspected_expected

Returns the value of attribute inspected_expected



13
14
15
# File 'lib/test/unit/assertion-failed-error.rb', line 13

def inspected_expected
  @inspected_expected
end

- (Object) user_message

Returns the value of attribute user_message



12
13
14
# File 'lib/test/unit/assertion-failed-error.rb', line 12

def user_message
  @user_message
end