From 1c7c6e5e90f4a26694e8eb991f18b38a5a5d7d32 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 23 Sep 2018 20:24:28 -0600 Subject: [PATCH] Initial code for example names --- src/spectator/example.cr | 6 ++++++ src/spectator/example_group.cr | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/spectator/example.cr b/src/spectator/example.cr index 0e9bc9a..9aef402 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -10,5 +10,11 @@ module Spectator end private getter locals + + def to_s(io) + @group.to_s(io) + io << ' ' + io << description + end end end diff --git a/src/spectator/example_group.cr b/src/spectator/example_group.cr index 6797508..8f62de3 100644 --- a/src/spectator/example_group.cr +++ b/src/spectator/example_group.cr @@ -85,5 +85,13 @@ module Spectator end wrapper end + + def to_s(io) + if (parent = @parent) + parent.to_s(io) + io << ' ' + end + io << what + end end end