class Test::Unit::Assertions::AssertionMessage::Inspector

Attributes

object[R]

Public Class Methods

cached_new(object, inspected_objects) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2003
def cached_new(object, inspected_objects)
  inspected_objects[object.object_id] ||=
    new(object, inspected_objects)
end
inspector_classes() click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2009
def inspector_classes
  @@inspector_classes
end
new(object, inspected_objects={}) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2023
def initialize(object, inspected_objects={})
  @inspected_objects = inspected_objects
  @object = object
  @inspected_objects[@object.object_id] = self
  @inspect_target = inspect_target
end
register_inspector_class(inspector_class) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2013
def register_inspector_class(inspector_class)
  @@inspector_classes << inspector_class
end
unregister_inspector_class(inspector_class) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2017
def unregister_inspector_class(inspector_class)
  @@inspector_classes.delete(inspector_class)
end

Public Instance Methods

<=>(other) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2043
def <=>(other)
  if other.is_a?(self.class)
    @object <=> other.object
  else
    @object <=> other
  end
end
inspect() click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2031
def inspect
  @inspect_target.inspect
end
Also aliased as: native_inspect
native_inspect()
Alias for: inspect
pretty_print(q) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2035
def pretty_print(q)
  @inspect_target.pretty_print(q)
end
pretty_print_cycle(q) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2039
def pretty_print_cycle(q)
  @inspect_target.pretty_print_cycle(q)
end

Private Instance Methods

inspect_target() click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2052
def inspect_target
  self.class.inspector_classes.each do |inspector_class|
    if inspector_class.target?(@object)
      return inspector_class.new(@object, @inspected_objects)
    end
  end
  @object
end