Set nameless example to matcher description

This commit is contained in:
Michael Miller 2021-01-30 21:00:01 -07:00
parent 82e13f5434
commit e44505d4c1
No known key found for this signature in database
GPG Key ID: FB9F12F7C646A4AD
1 changed files with 1 additions and 0 deletions

View File

@ -66,6 +66,7 @@ module Spectator
def report(expectation : Expectation) : Nil
Log.debug { "Reporting expectation #{expectation}" }
@expectations << expectation
Example.current.name = expectation.description unless Example.current.name?
raise ExpectationFailed.new(expectation) if expectation.failed?
end