Report failed expectation line

In output listing the failures, the comment line now shows the failed expectation line.
Previously this showed the example's source line.
This commit is contained in:
Michael Miller 2022-01-03 18:47:56 -07:00
parent 66e3155a0d
commit 07aa968d68
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2
2 changed files with 13 additions and 0 deletions

View file

@ -45,5 +45,13 @@ module Spectator::Formatting::Components
io << padding << key.colorize(:red) << ": ".colorize(:red) << value
end
end
# Produces the location line.
# This is where the result was determined.
private def location_line(io)
return unless location = @expectation.location? || @example.location?
line(io) { io << Comment.colorize(location) }
end
end
end