Skip to content

Commit

Permalink
fix(docs): correct Error usage examples
Browse files Browse the repository at this point in the history
Correct the usage of `assert.Equal` in the Error and NoError usage
examples, which had reversed the expected and actual arguments.
  • Loading branch information
terinjokes authored and DAddYE committed May 26, 2017
1 parent d2f3716 commit b6296e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
//
// actualObj, err := SomeFunction()
// if assert.NoError(t, err) {
// assert.Equal(t, actualObj, expectedObj)
// assert.Equal(t, expectedObj, actualObj)
// }
//
// Returns whether the assertion was successful (true) or not (false).
Expand All @@ -908,7 +908,7 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
//
// actualObj, err := SomeFunction()
// if assert.Error(t, err, "An error was expected") {
// assert.Equal(t, err, expectedError)
// assert.Equal(t, expectedError, err)
// }
//
// Returns whether the assertion was successful (true) or not (false).
Expand Down

0 comments on commit b6296e3

Please sign in to comment.