Skip to content

Commit

Permalink
Fix TestGetEnv failing
Browse files Browse the repository at this point in the history
  • Loading branch information
Naatan committed Jul 17, 2024
1 parent 569f0ac commit 58e4d14
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/runtime/internal/envdef/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"testing"

"github.com/ActiveState/cli/internal/osutils"
"github.com/ActiveState/cli/internal/testhelpers/suite"
"github.com/ActiveState/cli/pkg/runtime/internal/envdef"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -157,10 +158,18 @@ func (suite *EnvironmentTestSuite) TestGetEnv() {
}`), &ed1)
require.NoError(suite.T(), err)

res := ed1.GetEnv(true)
res := ed1.GetEnv(false)
suite.Assert().Equal(map[string]string{
"V": "a:b",
}, res)

res = ed1.GetEnv(true)
suite.Require().Contains(res, "V")
suite.Assert().Equal(res["V"], "a:b")
for k, v := range osutils.EnvSliceToMap(os.Environ()) {
suite.Require().Contains(res, k)
suite.Assert().Equal(res[k], v)
}
}

func (suite *EnvironmentTestSuite) TestFindBinPathFor() {
Expand Down

0 comments on commit 58e4d14

Please sign in to comment.