@@ -292,17 +292,15 @@ func doTest(t *testing.T, svcName string) {
292292}
293293
294294func TestWatchExec (t * testing.T ) {
295- cli := NewCLI (t )
295+ c := NewCLI (t )
296296 const projectName = "test_watch_exec"
297297
298- t .Cleanup (func () {
299- cli .RunDockerComposeCmd (t , "-p" , projectName , "down" )
300- })
298+ defer c .cleanupWithDown (t , projectName )
301299
302300 tmpdir := t .TempDir ()
303301 composeFilePath := filepath .Join (tmpdir , "compose.yaml" )
304302 CopyFile (t , filepath .Join ("fixtures" , "watch" , "exec.yaml" ), composeFilePath )
305- cmd := cli .NewDockerComposeCmd (t , "-p" , projectName , "-f" , composeFilePath , "up" , "--watch" )
303+ cmd := c .NewDockerComposeCmd (t , "-p" , projectName , "-f" , composeFilePath , "up" , "--watch" )
306304 buffer := bytes .NewBuffer (nil )
307305 cmd .Stdout = buffer
308306 watch := icmd .StartCmd (cmd )
@@ -327,5 +325,5 @@ func TestWatchExec(t *testing.T) {
327325 }
328326 return poll .Continue ("%v" , out )
329327 })
330- cli .RunDockerComposeCmdNoCheck (t , "-p" , projectName , "kill" , "-s" , "9" )
328+ c .RunDockerComposeCmdNoCheck (t , "-p" , projectName , "kill" , "-s" , "9" )
331329}
0 commit comments