Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change assertion to Assertion #586

Merged
merged 1 commit into from Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion convey/context.go
Expand Up @@ -169,7 +169,7 @@ func (ctx *context) SkipSo(stuff ...interface{}) {
ctx.assertionReport(reporting.NewSkipReport())
}

func (ctx *context) So(actual interface{}, assert assertion, expected ...interface{}) {
func (ctx *context) So(actual interface{}, assert Assertion, expected ...interface{}) {
if result := assert(actual, expected...); result == assertionSuccess {
ctx.assertionReport(reporting.NewSuccessReport())
} else {
Expand Down
8 changes: 4 additions & 4 deletions convey/doc.go
Expand Up @@ -23,7 +23,7 @@ type C interface {
SkipConvey(items ...interface{})
FocusConvey(items ...interface{})

So(actual interface{}, assert assertion, expected ...interface{})
So(actual interface{}, assert Assertion, expected ...interface{})
SkipSo(stuff ...interface{})

Reset(action func())
Expand Down Expand Up @@ -104,11 +104,11 @@ func Reset(action func()) {

/////////////////////////////////// Assertions ///////////////////////////////////

// assertion is an alias for a function with a signature that the convey.So()
// Assertion is an alias for a function with a signature that the convey.So()
// method can handle. Any future or custom assertions should conform to this
// method signature. The return value should be an empty string if the assertion
// passes and a well-formed failure message if not.
type assertion func(actual interface{}, expected ...interface{}) string
type Assertion func(actual interface{}, expected ...interface{}) string

const assertionSuccess = ""

Expand All @@ -121,7 +121,7 @@ const assertionSuccess = ""
// documentation on specific assertion methods. A failing assertion will
// cause t.Fail() to be invoked--you should never call this method (or other
// failure-inducing methods) in your test code. Leave that to GoConvey.
func So(actual interface{}, assert assertion, expected ...interface{}) {
func So(actual interface{}, assert Assertion, expected ...interface{}) {
mustGetCurrentContext().So(actual, assert, expected...)
}

Expand Down