@@ -193,20 +193,25 @@ func (suite *ShellIntegrationTestSuite) TestUseShellUpdates() {
193193 ts := e2e .New (suite .T (), false )
194194 defer ts .Close ()
195195
196- suite .SetupRCFile (ts )
196+ if runtime .GOOS != "windows" {
197+ ts .SetupRCFileCustom (& bash.SubShell {})
198+ ts .SetupRCFileCustom (& zsh.SubShell {})
199+ }
197200
198201 cp := ts .Spawn ("checkout" , "ActiveState-CLI/Empty" )
199202 cp .Expect ("Checked out project" )
200203 cp .ExpectExitCode (0 )
201204
202205 // Create a zsh RC file
203206 var zshRcFile string
204- var err error
205- if runtime .GOOS != "windows" {
206- zsh := & zsh.SubShell {}
207- zshRcFile , err = zsh .RcFile ()
208- suite .NoError (err )
209- }
207+ ts .WithEnv (func () {
208+ var err error
209+ if runtime .GOOS != "windows" {
210+ zsh := & zsh.SubShell {}
211+ zshRcFile , err = zsh .RcFile ()
212+ suite .NoError (err )
213+ }
214+ })
210215
211216 cp = ts .SpawnWithOpts (
212217 e2e .OptArgs ("use" , "ActiveState-CLI/Empty" ),
@@ -216,13 +221,12 @@ func (suite *ShellIntegrationTestSuite) TestUseShellUpdates() {
216221 cp .ExpectExitCode (0 )
217222
218223 // Ensure both bash and zsh RC files are updated
219- cfg , err := config .New ()
220- suite .NoError (err )
221- rcfile , err := subshell .New (cfg ).RcFile ()
224+ rcfile , err := subshell .New (ts .Config ()).RcFile ()
225+ rcfile = filepath .Join (ts .Dirs .HomeDir , filepath .Base (rcfile ))
222226 if runtime .GOOS != "windows" && fileutils .FileExists (rcfile ) {
223227 suite .NoError (err )
224- suite .Contains (string (fileutils .ReadFileUnsafe (rcfile )), ts .Dirs .DefaultBin , " PATH does not have your project in it" )
225- suite .Contains (string (fileutils .ReadFileUnsafe (zshRcFile )), ts .Dirs .DefaultBin , " PATH does not have your project in it" )
228+ suite .Contains (string (fileutils .ReadFileUnsafe (rcfile )), ts .Dirs .DefaultBin , rcfile + ": PATH does not have your project in it" )
229+ suite .Contains (string (fileutils .ReadFileUnsafe (zshRcFile )), ts .Dirs .DefaultBin , zshRcFile + ": PATH does not have your project in it" )
226230 }
227231}
228232
@@ -237,15 +241,6 @@ func (suite *ShellIntegrationTestSuite) TestJSON() {
237241 AssertValidJSON (suite .T (), cp )
238242}
239243
240- func (suite * ShellIntegrationTestSuite ) SetupRCFile (ts * e2e.Session ) {
241- if runtime .GOOS == "windows" {
242- return
243- }
244-
245- ts .SetupRCFile ()
246- ts .SetupRCFileCustom (& zsh.SubShell {})
247- }
248-
249244func (suite * ShellIntegrationTestSuite ) TestRuby () {
250245 suite .OnlyRunForTags (tagsuite .Shell )
251246 ts := e2e .New (suite .T (), false )
0 commit comments