blob: b4a60ff3c18b2d6dde7864d1bb50c07c83c9f7ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"])
assert.NoError(t, os.Setenv("FOO", "foo"))
assert.Equal(t, c.Env()["FOO"], "foo")
}
|