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.
1552 1553 1554 1555 1556 1557 |
# File 'lib/test/unit/assertions.rb', line 1552 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.
1551 1552 1553 |
# File 'lib/test/unit/assertions.rb', line 1551 def object @object end |
Class Method Details
.cached_new(object, inspected_objects) ⇒ Object
1545 1546 1547 1548 |
# File 'lib/test/unit/assertions.rb', line 1545 def cached_new(object, inspected_objects) inspected_objects[object.object_id] ||= new(object, inspected_objects) end |
Instance Method Details
#<=>(other) ⇒ Object
1572 1573 1574 1575 1576 1577 1578 |
# File 'lib/test/unit/assertions.rb', line 1572 def <=>(other) if other.is_a?(self.class) @object <=> other.object else @object <=> other end end |
#inspect ⇒ Object
1560 1561 1562 |
# File 'lib/test/unit/assertions.rb', line 1560 def inspect @inspect_target.inspect end |
#native_inspect ⇒ Object
1559 |
# File 'lib/test/unit/assertions.rb', line 1559 alias_method :native_inspect, :inspect |
#pretty_print(q) ⇒ Object
1564 1565 1566 |
# File 'lib/test/unit/assertions.rb', line 1564 def pretty_print(q) @inspect_target.pretty_print(q) end |
#pretty_print_cycle(q) ⇒ Object
1568 1569 1570 |
# File 'lib/test/unit/assertions.rb', line 1568 def pretty_print_cycle(q) @inspect_target.pretty_print_cycle(q) end |