github.com/CUCUMBER/godog@v0.7.9/utils_test.go (about) 1 package godog 2 3 import ( 4 "testing" 5 "time" 6 ) 7 8 // this zeroes the time throughout whole test suite 9 // and makes it easier to assert output 10 // activated only when godog tests are being run 11 func init() { 12 timeNowFunc = func() time.Time { 13 return time.Time{} 14 } 15 } 16 17 func TestTimeNowFunc(t *testing.T) { 18 now := timeNowFunc() 19 if !now.IsZero() { 20 t.Fatalf("expected zeroed time, but got: %s", now.Format(time.RFC3339)) 21 } 22 }