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

README.md should include actual usage examples #29

Closed ghostsquad closed 6 years ago

ghostsquad commented 6 years ago

func ShouldBeTrue

func ShouldBeTrue(actual interface{}, expected ...interface{}) string

ShouldBeTrue receives a single parameter and ensures that it is true.

The example (which really isn't even an example, but more of a method signature) doesn't match the description.

I think it would be better to provide examples of each method instead of the signature, which looks identical to every other method, and doesn't really provide any value.

mdwhatcott commented 6 years ago

Gotcha. I think I understand your concern. The current README.md is basically the godoc string rendered as markdown. Because each of the assertions function must share the assertion type signature it looks funny in cases like ShouldBeTrue where we only accept a single parameter at runtime. IMO, the best documentation for these functions are the unit tests--they already illustrate the intended use cases for each assertion.

I'm not opposed to updating the readme to be more example-based, but there's quite a few assertion functions. :) Could you include a draft of what you had in mind for this function?

ghostsquad commented 6 years ago

I'll send a PR. 😄