Class: Test::Unit::Assertions::AssertionMessage::Inspector
- Inherits:
-
Object
- Object
- Test::Unit::Assertions::AssertionMessage::Inspector
- Includes:
- Comparable
- Defined in:
- lib/test/unit/assertions.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(object, inspected_objects = {}) ⇒ Inspector
constructor
A new instance of Inspector.
- #inspect ⇒ Object
- #native_inspect ⇒ Object
- #pretty_print(q) ⇒ Object
- #pretty_print_cycle(q) ⇒ Object
Constructor Details
#initialize(object, inspected_objects = {}) ⇒ Inspector
Returns a new instance of Inspector.
1545 1546 1547 1548 1549 1550 |
# File 'lib/test/unit/assertions.rb', line 1545 def initialize(object, inspected_objects={}) @inspected_objects = inspected_objects @object = object @inspected_objects[@object.object_id] = self @inspect_target = inspect_target end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
1544 1545 1546 |
# File 'lib/test/unit/assertions.rb', line 1544 def object @object end |
Class Method Details
.cached_new(object, inspected_objects) ⇒ Object
1538 1539 1540 1541 |
# File 'lib/test/unit/assertions.rb', line 1538 def cached_new(object, inspected_objects) inspected_objects[object.object_id] ||= new(object, inspected_objects) end |
Instance Method Details
#<=>(other) ⇒ Object
1565 1566 1567 1568 1569 1570 1571 |
# File 'lib/test/unit/assertions.rb', line 1565 def <=>(other) if other.is_a?(self.class) @object <=> other.object else @object <=> other end end |
#inspect ⇒ Object
1553 1554 1555 |
# File 'lib/test/unit/assertions.rb', line 1553 def inspect @inspect_target.inspect end |
#native_inspect ⇒ Object
1552 |
# File 'lib/test/unit/assertions.rb', line 1552 alias_method :native_inspect, :inspect |
#pretty_print(q) ⇒ Object
1557 1558 1559 |
# File 'lib/test/unit/assertions.rb', line 1557 def pretty_print(q) @inspect_target.pretty_print(q) end |
#pretty_print_cycle(q) ⇒ Object
1561 1562 1563 |
# File 'lib/test/unit/assertions.rb', line 1561 def pretty_print_cycle(q) @inspect_target.pretty_print_cycle(q) end |