@@ -22,6 +22,7 @@ import (
2222 "testing"
2323
2424 "github.com/stretchr/testify/assert"
25+ "github.com/stretchr/testify/require"
2526
2627 "github.com/docker/compose/v2/pkg/api"
2728)
@@ -41,7 +42,7 @@ func TestPs(t *testing.T) {
4142
4243 t .Run ("pretty" , func (t * testing.T ) {
4344 res = c .RunDockerComposeCmd (t , "-f" , "./fixtures/ps-test/compose.yaml" , "--project-name" , projectName , "ps" )
44- lines := strings .Split (res .Combined (), "\n " )
45+ lines := strings .Split (res .Stdout (), "\n " )
4546 assert .Equal (t , 4 , len (lines ))
4647 count := 0
4748 for _ , line := range lines [1 :3 ] {
@@ -61,8 +62,8 @@ func TestPs(t *testing.T) {
6162 res = c .RunDockerComposeCmd (t , "-f" , "./fixtures/ps-test/compose.yaml" , "--project-name" , projectName , "ps" ,
6263 "--format" , "json" )
6364 var output []api.ContainerSummary
64- err := json .Unmarshal ([]byte (res .Combined ()), & output )
65- assert .NoError (t , err )
65+ err := json .Unmarshal ([]byte (res .Stdout ()), & output )
66+ require .NoError (t , err , "Failed to unmarshal ps JSON output" )
6667
6768 count := 0
6869 assert .Equal (t , 2 , len (output ))
0 commit comments