summaryrefslogtreecommitdiff
path: root/context_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'context_test.go')
-rw-r--r--context_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/context_test.go b/context_test.go
new file mode 100644
index 00000000..4e339533
--- /dev/null
+++ b/context_test.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "os"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestEnvMapifiesEnvironment(t *testing.T) {
+ c := &Context{}
+ env := c.Env()
+ assert.Equal(t, env["USER"], os.Getenv("USER"))
+}
+
+func TestEnvGetsUpdatedEnvironment(t *testing.T) {
+ c := &Context{}
+ assert.Empty(t, c.Env()["FOO"])
+ os.Setenv("FOO", "foo")
+ assert.Equal(t, c.Env()["FOO"], "foo")
+}