Skip to content

Commit c3969f3

Browse files
committed
Fix TestUseIntegrationTestSuite/TestReset
1 parent 728a46b commit c3969f3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/integration/use_int_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"runtime"
88
"testing"
99

10-
"github.com/ActiveState/cli/internal/config"
1110
"github.com/ActiveState/cli/internal/fileutils"
1211
"github.com/ActiveState/cli/internal/locale"
1312
"github.com/ActiveState/cli/internal/osutils"
@@ -124,12 +123,14 @@ func (suite *UseIntegrationTestSuite) TestReset() {
124123
python3Exe := filepath.Join(ts.Dirs.DefaultBin, "python3"+osutils.ExeExtension)
125124
suite.True(fileutils.TargetExists(python3Exe), python3Exe+" not found")
126125

127-
cfg, err := config.New()
128-
suite.NoError(err)
129-
rcfile, err := subshell.New(cfg).RcFile()
130-
if runtime.GOOS != "windows" && fileutils.FileExists(rcfile) {
126+
var rcfile string
127+
ts.WithEnv(func() {
128+
var err error
129+
rcfile, err = subshell.New(ts.Config()).RcFile()
131130
suite.NoError(err)
132-
suite.Contains(string(fileutils.ReadFileUnsafe(rcfile)), ts.Dirs.DefaultBin, "PATH does not have your project in it")
131+
})
132+
if runtime.GOOS != "windows" && fileutils.FileExists(rcfile) {
133+
suite.Contains(string(fileutils.ReadFileUnsafe(rcfile)), ts.Dirs.DefaultBin, ts.DebugMessage("PATH does not have your project in it"))
133134
}
134135

135136
cp = ts.Spawn("use", "reset")

0 commit comments

Comments
 (0)