diff --git a/src/spectator/example.cr b/src/spectator/example.cr index 7c641a6..17cf51a 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -160,17 +160,8 @@ module Spectator # Exposes information about the example useful for debugging. def inspect(io) - # Full example name. - io << '"' - to_s(io) - io << '"' - - # Add location if it's available. - if (location = self.location) - io << " @ " - io << location - end - + super + io << ' ' io << result end diff --git a/src/spectator/node.cr b/src/spectator/node.cr index 4afe273..7a562e1 100644 --- a/src/spectator/node.cr +++ b/src/spectator/node.cr @@ -51,5 +51,19 @@ module Spectator def to_s(io) (@name || "").to_s(io) end + + # Exposes information about the node useful for debugging. + def inspect(io) + # Full node name. + io << '"' + to_s(io) + io << '"' + + # Add location if it's available. + if (location = self.location) + io << " @ " + io << location + end + end end end