summary refs log tree commit diff stats
path: root/svc/conf_test.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-09 03:12:04 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-09 03:12:04 -0400
commit5f06e58a09c21e8016197fc8eefc38a86e9eb3e7 (patch)
tree9278f0aa6580ae3229d34446fe960923337a2fd1 /svc/conf_test.go
parente10fc64f9855262c4a9511025dffcc1d603c7206 (diff)
downloadgetwtxt-5f06e58a09c21e8016197fc8eefc38a86e9eb3e7.tar.gz
config init test
Diffstat (limited to 'svc/conf_test.go')
-rw-r--r--svc/conf_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/svc/conf_test.go b/svc/conf_test.go
new file mode 100644
index 0000000..37e64a6
--- /dev/null
+++ b/svc/conf_test.go
@@ -0,0 +1,22 @@
+package svc
+
+import (
+	"reflect"
+	"testing"
+)
+
+func Test_initConfig(t *testing.T) {
+	t.Run("Testing Configuration Initialization", func(t *testing.T) {
+
+		initConfig()
+		confObj.Mu.RLock()
+		cnf := reflect.Indirect(reflect.ValueOf(confObj))
+		confObj.Mu.RUnlock()
+
+		for i := 0; i < cnf.NumField(); i++ {
+			if !cnf.Field(i).IsValid() {
+				t.Errorf("Uninitialized value: %v\n", cnf.Field(i).Type())
+			}
+		}
+	})
+}