summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
new file mode 100644
index 0000000..1a79320
--- /dev/null
+++ b/internal/config/config_test.go
@@ -0,0 +1,24 @@
+package config
+
+import (
+ "os"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
+)
+
+func TestConfigApplyGlobalState(t *testing.T) {
+ t.Cleanup(testhelper.TempEnv(map[string]string{"SSL_CERT_DIR": "unmodified"}))
+
+ config := &Config{SslCertDir: ""}
+ config.ApplyGlobalState()
+
+ require.Equal(t, "unmodified", os.Getenv("SSL_CERT_DIR"))
+
+ config.SslCertDir = "foo"
+ config.ApplyGlobalState()
+
+ require.Equal(t, "foo", os.Getenv("SSL_CERT_DIR"))
+}