aboutsummaryrefslogtreecommitdiff
path: root/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/config_test.go')
-rw-r--r--config/config_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/config/config_test.go b/config/config_test.go
index 34009d7..6fce23b 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -4,23 +4,27 @@ import (
"testing"
)
+const SCHEMA_PATH string = "../config_schema.json"
+
func TestNoConfig(t *testing.T) {
- _, err := ReadConfig("../test/sfklase.yml")
+ _, err := ReadConfig("../test/sfklase.yml", SCHEMA_PATH)
if err == nil {
t.Errorf("Non-existent config was successfully read")
}
}
func TestGoodConfig(t *testing.T) {
- _, err := ReadConfig("../test/good_config.yml")
+ _, err := ReadConfig("../test/good_config.yml", SCHEMA_PATH)
if err != nil {
t.Errorf("Good config is not accepted: %v", err)
}
}
func TestBadConfig(t *testing.T) {
- _, err := ReadConfig("../test/bad_config.yml")
+ _, err := ReadConfig("../test/bad_config.yml", SCHEMA_PATH)
if err == nil {
- t.Errorf("Bad config is accepted but it shoudn't!")
+ t.Errorf("Bad config is accepted but it shouldn't!")
+ } else {
+ t.Log(err)
}
}