summaryrefslogtreecommitdiff
path: root/go/internal/config/config_test.go
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-04-28 18:16:55 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-05-23 15:26:35 +0200
commit25a32cfa1e0b1c7e6af723053bad0f432ffd0b32 (patch)
treebc6d2958eeedb0b0c15d329ec90cc6d0d90cb919 /go/internal/config/config_test.go
parent285c061ed8933c0d94a9ad027f99653039673324 (diff)
downloadgitlab-shell-25a32cfa1e0b1c7e6af723053bad0f432ffd0b32.tar.gz
Use gitaly-upload-pack and gitaly-receive-pack
Diffstat (limited to 'go/internal/config/config_test.go')
-rw-r--r--go/internal/config/config_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/go/internal/config/config_test.go b/go/internal/config/config_test.go
new file mode 100644
index 0000000..0ca2dab
--- /dev/null
+++ b/go/internal/config/config_test.go
@@ -0,0 +1,28 @@
+package config
+
+import (
+ "testing"
+)
+
+func TestConfigLogFile(t *testing.T) {
+ testRoot := "/foo/bar"
+ testCases := []struct {
+ yaml string
+ path string
+ }{
+ {path: "/foo/bar/gitlab-shell.log"},
+ {yaml: "log_file: my-log.log", path: "/foo/bar/my-log.log"},
+ {yaml: "log_file: /qux/my-log.log", path: "/qux/my-log.log"},
+ }
+
+ for _, tc := range testCases {
+ cfg := Config{RootDir: testRoot}
+ if err := parseConfig([]byte(tc.yaml), &cfg); err != nil {
+ t.Fatalf("%q: %v", tc.yaml, err)
+ }
+
+ if cfg.LogFile != tc.path {
+ t.Fatalf("%q: expected %q, got %q", tc.yaml, tc.path, cfg.LogFile)
+ }
+ }
+}