Skip to content

Commit

Permalink
Merge pull request #586 from mantyr/mantyr/C
Browse files Browse the repository at this point in the history
change assertion to Assertion
  • Loading branch information
riannucci committed Apr 27, 2021
2 parents 4a1671f + af903d8 commit 5f060cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 5f060cc

Please sign in to comment.