mirror of https://github.com/shunfei/cronsun
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
506 B
30 lines
506 B
8 years ago
|
package utils
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
. "github.com/smartystreets/goconvey/convey"
|
||
|
)
|
||
|
|
||
|
func TestLoadExtendConf(t *testing.T) {
|
||
|
testFile := "test.json"
|
||
|
|
||
|
type conf struct {
|
||
|
Debug bool
|
||
|
Num int
|
||
|
Log struct {
|
||
|
Level int
|
||
|
Path string
|
||
|
}
|
||
|
}
|
||
|
Convey("confutil package test", t, func() {
|
||
|
Convey("load test file should be success", func() {
|
||
|
c := &conf{}
|
||
|
err := LoadExtendConf(testFile, c)
|
||
|
So(err, ShouldBeNil)
|
||
|
So(c.Debug, ShouldBeTrue)
|
||
|
So(c.Log.Path, ShouldEqual, "./tmp")
|
||
|
})
|
||
|
})
|
||
|
}
|