@@ -13,6 +13,7 @@ import (
13
13
"strings"
14
14
"testing"
15
15
16
+ "github.com/google/go-cmp/cmp"
16
17
"github.com/ory/dockertest/v3"
17
18
"github.com/ory/dockertest/v3/docker"
18
19
"github.com/stretchr/testify/assert"
@@ -681,10 +682,10 @@ func TestDevcontainerFeatures_OptionsAsEnvs(t *testing.T) {
681
682
},
682
683
},
683
684
want : []string {
684
- "FEATURE_CODE_SERVER_PORT=9090" ,
685
685
"FEATURE_CODE_SERVER_PASSWORD=secret" ,
686
- "FEATURE_DOCKER_IN_DOCKER_MOBY=false " ,
686
+ "FEATURE_CODE_SERVER_PORT=9090 " ,
687
687
"FEATURE_DOCKER_IN_DOCKER_DOCKER_DASH_COMPOSE_VERSION=v2" ,
688
+ "FEATURE_DOCKER_IN_DOCKER_MOBY=false" ,
688
689
},
689
690
},
690
691
{
@@ -717,7 +718,7 @@ func TestDevcontainerFeatures_OptionsAsEnvs(t *testing.T) {
717
718
{
718
719
name : "empty features" ,
719
720
features : agentcontainers.DevcontainerFeatures {},
720
- want : [] string {} ,
721
+ want : nil ,
721
722
},
722
723
}
723
724
@@ -726,11 +727,8 @@ func TestDevcontainerFeatures_OptionsAsEnvs(t *testing.T) {
726
727
t .Parallel ()
727
728
728
729
got := tt .features .OptionsAsEnvs ()
729
-
730
- require .Len (t , got , len (tt .want ), "number of environment variables should match" )
731
-
732
- for _ , expected := range tt .want {
733
- assert .Contains (t , got , expected , "expected environment variable not found" )
730
+ if diff := cmp .Diff (tt .want , got ); diff != "" {
731
+ require .Failf (t , "OptionsAsEnvs() mismatch (-want +got):\n %s" , diff )
734
732
}
735
733
})
736
734
}
0 commit comments