@@ -22,6 +22,7 @@ import (
22
22
"testing"
23
23
24
24
"github.com/stretchr/testify/assert"
25
+ "github.com/stretchr/testify/require"
25
26
26
27
"github.com/docker/compose/v2/pkg/api"
27
28
)
@@ -41,7 +42,7 @@ func TestPs(t *testing.T) {
41
42
42
43
t .Run ("pretty" , func (t * testing.T ) {
43
44
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 " )
45
46
assert .Equal (t , 4 , len (lines ))
46
47
count := 0
47
48
for _ , line := range lines [1 :3 ] {
@@ -61,8 +62,8 @@ func TestPs(t *testing.T) {
61
62
res = c .RunDockerComposeCmd (t , "-f" , "./fixtures/ps-test/compose.yaml" , "--project-name" , projectName , "ps" ,
62
63
"--format" , "json" )
63
64
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" )
66
67
67
68
count := 0
68
69
assert .Equal (t , 2 , len (output ))
0 commit comments