Based on the docs, there should be a require.Truef() function (and corresponding Assertions.Truef() method, however I'm getting an undefined: require.Truef when executing the following (using 1.1.4 release of testify):
$ cat sample_test.go
package util
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestAssert(t *testing.T) {
val := true
assert.Truef(t, true, "%v should be true.", val)
}
func TestRequire(t *testing.T) {
val := true
require.Truef(t, true, "%v should be true.", val)
}
results in:
$ go test ./...
sample_test.go:17: undefined: require.Truef
when I run a similar test with the Assertions.Truef() method, I get a similar failure:
$ cat sample_test.go
package util
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestAssert(t *testing.T) {
assert := assert.New(t)
val := true
assert.Truef(true, "%v should be true.", val)
}
func TestRequire(t *testing.T) {
require := require.New(t)
val := true
require.Truef(true, "%v should be true.", val)
}
results in a similar error:
$ go test ./...
sample_test.go:19: require.Truef undefined (type *require.Assertions has no field or method Truef)
Again, if I remove the requires example, everything works fine.
Any ideas?
-jay
Based on the docs, there should be a
require.Truef()function (and correspondingAssertions.Truef()method, however I'm getting anundefined: require.Truefwhen executing the following (using 1.1.4 release of testify):results in:
when I run a similar test with the
Assertions.Truef()method, I get a similar failure:results in a similar error:
Again, if I remove the requires example, everything works fine.
Any ideas?
-jay