@@ -12,7 +12,6 @@ import (
1212
1313 "github.com/ActiveState/cli/internal/testhelpers/suite"
1414
15- "github.com/ActiveState/cli/internal/config"
1615 "github.com/ActiveState/cli/internal/constants"
1716 "github.com/ActiveState/cli/internal/fileutils"
1817 "github.com/ActiveState/cli/internal/subshell"
@@ -205,7 +204,9 @@ func (suite *DeployIntegrationTestSuite) TestDeployPython() {
205204 cp .SendLine ("exit" )
206205 cp .ExpectExitCode (0 )
207206
208- suite .AssertConfig (ts , targetID .String ())
207+ ts .WithEnv (func () {
208+ suite .AssertConfig (ts , targetID .String ())
209+ })
209210}
210211
211212func (suite * DeployIntegrationTestSuite ) TestDeployInstall () {
@@ -290,17 +291,17 @@ func (suite *DeployIntegrationTestSuite) TestDeployConfigure() {
290291func (suite * DeployIntegrationTestSuite ) AssertConfig (ts * e2e.Session , targetID string ) {
291292 if runtime .GOOS != "windows" {
292293 // Test config file
293- cfg , err := config .New ()
294- suite .Require ().NoError (err )
295294
296- subshell := subshell .New (cfg )
297- rcFile , err := subshell .RcFile ()
298- suite .Require ().NoError (err )
295+ ts .WithEnv (func () {
296+ subshell := subshell .New (ts .Config ())
297+ rcFile , err := subshell .RcFile ()
298+ suite .Require ().NoError (err )
299299
300- bashContents := fileutils .ReadFileUnsafe (rcFile )
301- suite .Contains (string (bashContents ), constants .RCAppendDeployStartLine , "config file should contain our RC Append Start line" )
302- suite .Contains (string (bashContents ), constants .RCAppendDeployStopLine , "config file should contain our RC Append Stop line" )
303- suite .Contains (string (bashContents ), targetID , "config file should contain our target dir" )
300+ bashContents := fileutils .ReadFileUnsafe (rcFile )
301+ suite .Contains (string (bashContents ), constants .RCAppendDeployStartLine , "config file should contain our RC Append Start line" )
302+ suite .Contains (string (bashContents ), constants .RCAppendDeployStopLine , "config file should contain our RC Append Stop line" )
303+ suite .Contains (string (bashContents ), targetID , "config file should contain our target dir" )
304+ })
304305 } else {
305306 // Test registry
306307 out , err := exec .Command ("reg" , "query" , `HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment` , "/v" , "Path" ).Output ()
0 commit comments