diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2016-01-23 21:16:13 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2016-01-23 21:16:13 -0500 |
| commit | e027120266a82dcd7d37ec1d0d14873fa70742fe (patch) | |
| tree | 6623e3f62dcd69d2151a6fea9e5cd9703fcb7b4a /context_test.go | |
| parent | 6e8d894ec5de37591eee4e73bc06c74c0f3725b6 (diff) | |
💄 slight refactoring & adding some vague unit tests...
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'context_test.go')
| -rw-r--r-- | context_test.go | 21 |
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") +} |
