mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Display group names
This commit is contained in:
parent
f338e9b99d
commit
52a6a645b9
1 changed files with 14 additions and 1 deletions
|
@ -15,11 +15,24 @@ module Spectator::Formatting
|
||||||
|
|
||||||
# Does nothing when an example is started.
|
# Does nothing when an example is started.
|
||||||
def start_example(example)
|
def start_example(example)
|
||||||
# TODO: Display group names.
|
# TODO: Condense similar parents.
|
||||||
|
current_group = example.group
|
||||||
|
group_list = [] of NestedExampleGroup
|
||||||
|
while current_group.is_a?(NestedExampleGroup)
|
||||||
|
group_list << current_group
|
||||||
|
current_group = current_group.parent
|
||||||
|
end
|
||||||
|
indent = 0
|
||||||
|
group_list.reverse_each do |group|
|
||||||
|
indent.times { @io.print ' ' }
|
||||||
|
@io.puts group.what
|
||||||
|
indent += 2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produces a single character output based on a result.
|
# Produces a single character output based on a result.
|
||||||
def end_example(result)
|
def end_example(result)
|
||||||
|
# TODO: Indent.
|
||||||
@io.puts result.call(Color) { result.example.what }
|
@io.puts result.call(Color) { result.example.what }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue