Fix nil reference error when example name is unavailable

This commit is contained in:
Michael Miller 2021-04-26 16:53:04 -06:00
parent 29594eefab
commit 5dfc60d4cd
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -29,7 +29,7 @@ module Spectator::Formatting
# Produces a single character output based on a result.
def end_example(result)
@previous_hierarchy.size.times { @io.print INDENT }
@io.puts result.accept(Color) { result.example.name }
@io.puts result.accept(Color) { result.example }
end
# Produces a list of groups making up the hierarchy for an example.