diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2019-10-26 14:11:19 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2019-10-26 14:17:22 -0400 |
| commit | 1c1f0f5be4436a6454e17e166f0e950ff30b48c3 (patch) | |
| tree | 2b1cd8f7e063345235a35d11a93706f7773dd6a3 /context_test.go | |
| parent | 3dc820699130f73dd086469f1a385b60164ead33 (diff) | |
Refactor context naming to reduce confusion
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'context_test.go')
| -rw-r--r-- | context_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/context_test.go b/context_test.go index f2780356..37362104 100644 --- a/context_test.go +++ b/context_test.go @@ -11,20 +11,20 @@ import ( ) func TestEnvMapifiesEnvironment(t *testing.T) { - c := &context{} + c := &tmplctx{} env := c.Env() assert.Equal(t, env["USER"], os.Getenv("USER")) } func TestEnvGetsUpdatedEnvironment(t *testing.T) { - c := &context{} + c := &tmplctx{} assert.Empty(t, c.Env()["FOO"]) assert.NoError(t, os.Setenv("FOO", "foo")) assert.Equal(t, c.Env()["FOO"], "foo") } func TestCreateContext(t *testing.T) { - c, err := createContext(nil, nil) + c, err := createTmplContext(nil, nil) assert.NoError(t, err) assert.Empty(t, c) @@ -40,16 +40,16 @@ func TestCreateContext(t *testing.T) { } os.Setenv("foo", "foo: bar") defer os.Unsetenv("foo") - c, err = createContext([]string{"foo=" + fooURL}, d) + c, err = createTmplContext([]string{"foo=" + fooURL}, d) assert.NoError(t, err) - assert.IsType(t, &context{}, c) - ctx := c.(*context) + assert.IsType(t, &tmplctx{}, c) + ctx := c.(*tmplctx) ds := ((*ctx)["foo"]).(map[string]interface{}) assert.Equal(t, "bar", ds["foo"]) os.Setenv("bar", "bar: baz") defer os.Unsetenv("bar") - c, err = createContext([]string{".=" + barURL}, d) + c, err = createTmplContext([]string{".=" + barURL}, d) assert.NoError(t, err) assert.IsType(t, map[string]interface{}{}, c) ds = c.(map[string]interface{}) |
