go-common/app/job/main/passport-game-local/service/service_test.go

30 lines
407 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"sync"
"testing"
"go-common/app/job/main/passport-game-local/conf"
. "github.com/smartystreets/goconvey/convey"
)
var (
once sync.Once
s *Service
)
func startService() {
if err := conf.Init(); err != nil {
panic(err)
}
s = New(conf.Conf)
}
func TestNew(t *testing.T) {
once.Do(startService)
Convey("ping should ok", t, func() {
So(s.Ping, ShouldBeNil)
})
}