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

View file

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