diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 17:16:14 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 18:24:20 +0100 |
commit | c9849d667ab55c23d343332a11afb3eb8ede3f2d (patch) | |
tree | 86684d5481d8b12be84ea1a3a8f32afaac007efa /vendor/github.com/stretchr | |
parent | 49f40a952943f26494d6407dc608b50b2ec0df7f (diff) |
Update vendor libs
Diffstat (limited to 'vendor/github.com/stretchr')
-rw-r--r-- | vendor/github.com/stretchr/testify/assert/assertions.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index d7c16c5..348d5f1 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -832,11 +832,11 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m // // Returns whether the assertion was successful (true) or not (false). func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { - if isNil(err) { - return true + if err != nil { + return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...) } - return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...) + return true } // Error asserts that a function returned an error (i.e. not `nil`). @@ -850,8 +850,11 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { message := messageFromMsgAndArgs(msgAndArgs...) - return NotNil(t, err, "An error is expected but got nil. %s", message) + if err == nil { + return Fail(t, "An error is expected but got nil. %s", message) + } + return true } // EqualError asserts that a function returned an error (i.e. not `nil`) |