godog/utils_test.go
2017-04-28 15:46:11 +03:00

22 строки
420 Б
Go

package godog
import (
"testing"
"time"
)
// this zeroes the time throughout whole test suite
// and makes it easier to assert output
// activated only when godog tests are being run
func init() {
timeNowFunc = func() time.Time {
return time.Time{}
}
}
func TestTimeNowFunc(t *testing.T) {
now := timeNowFunc()
if !now.IsZero() {
t.Fatalf("expected zeroed time, but got: %s", now.Format(time.RFC3339))
}
}