Fix '<anonymous>' showing up for root group

This commit is contained in:
Michael Miller 2021-05-16 19:37:45 -06:00
parent 84ac41967b
commit aee171656a
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -121,11 +121,11 @@ module Spectator
# Constructs the full name or description of the example group. # Constructs the full name or description of the example group.
# This prepends names of groups this group is part of. # This prepends names of groups this group is part of.
def to_s(io) def to_s(io)
name = @name
# Prefix with group's full name if the node belongs to a group. # Prefix with group's full name if the node belongs to a group.
if (parent = @group) return unless parent = @group
parent.to_s(io) parent.to_s(io)
name = @name
# Add padding between the node names # Add padding between the node names
# only if the names don't appear to be symbolic. # only if the names don't appear to be symbolic.
@ -133,7 +133,6 @@ module Spectator
io << ' ' unless !parent.name? || # ameba:disable Style/NegatedConditionsInUnless io << ' ' unless !parent.name? || # ameba:disable Style/NegatedConditionsInUnless
(parent.name?.is_a?(Symbol) && name.is_a?(String) && (parent.name?.is_a?(Symbol) && name.is_a?(String) &&
(name.starts_with?('#') || name.starts_with?('.'))) (name.starts_with?('#') || name.starts_with?('.')))
end
super super
end end