Accept an interface instead of testing.T (#1)
This commit is contained in:
parent
66ad00ea84
commit
fe8a28286e
3 changed files with 10 additions and 5 deletions
|
@ -3,14 +3,13 @@ package assert
|
|||
import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Assert is a helper for tests
|
||||
type Assert func(bool, ...interface{})
|
||||
|
||||
// New returns a new Assert
|
||||
func New(t *testing.T) Assert {
|
||||
func New(t T) Assert {
|
||||
a := func(ok bool, msg ...interface{}) {
|
||||
if !ok {
|
||||
if msg == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue