smarty / assertions

Fluent assertion-style functions used by goconvey and gunit. Can also be used in any test or application.
Other
100 stars 34 forks source link

ShouldEqual makes use of Equality method (if defined) #21

Closed mdwhatcott closed 7 years ago

mdwhatcott commented 7 years ago

This pull request allows time values to be compared using ShouldEqual. More generally, it allows any two structs (or pointers) to be compared if they are of the same time underlying type and that type implements a method named Equal that receives another instance of its own type as an input argument and returns a bool indicating whether to receiver and the argument are considered equal.

time.Time satisfies the requirements above with it's Equal method:

func (t Time) Equal(u Time) bool


See the following issues for context leading up to this pull request: