2017-09-07 08:58:58 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCheckConfig(t *testing.T) {
|
|
|
|
err := CheckConfig([]string{"testdata/conf.good.yml"})
|
|
|
|
if err != nil {
|
2017-11-12 16:43:48 +00:00
|
|
|
t.Fatalf("checking valid config file failed with: %v", err)
|
2017-09-07 08:58:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
err = CheckConfig([]string{"testdata/conf.bad.yml"})
|
|
|
|
if err == nil {
|
2017-11-12 16:43:48 +00:00
|
|
|
t.Fatalf("failed to detect invalid file.")
|
2017-09-07 08:58:58 +00:00
|
|
|
}
|
|
|
|
}
|