Skip to content

Commit 11ef957

Browse files
gloursndeloof
authored andcommitted
add test to check 'x-' named resources
Signed-off-by: Guillaume Lours <[email protected]>
1 parent a5007e7 commit 11ef957

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

loader/loader_test.go

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,15 +2394,31 @@ name: 'test-x-service'
23942394
services:
23952395
x-foo:
23962396
image: busybox
2397+
volumes:
2398+
- x-volume:/dev/null
2399+
configs:
2400+
- x-config
2401+
secrets:
2402+
- x-secret
2403+
networks:
2404+
- x-network
2405+
volumes:
2406+
x-volume:
2407+
secrets:
2408+
x-secret:
2409+
external: true
2410+
networks:
2411+
x-network:
2412+
configs:
2413+
x-config:
2414+
external: true
23972415
`)
23982416
assert.NilError(t, err)
2399-
assert.DeepEqual(t, p.Services, types.Services{
2400-
"x-foo": {
2401-
Name: "x-foo",
2402-
Image: "busybox",
2403-
Environment: types.MappingWithEquals{},
2404-
},
2405-
})
2417+
assert.DeepEqual(t, p.ServiceNames(), []string{"x-foo"})
2418+
assert.DeepEqual(t, p.SecretNames(), []string{"x-secret"})
2419+
assert.DeepEqual(t, p.VolumeNames(), []string{"x-volume"})
2420+
assert.DeepEqual(t, p.ConfigNames(), []string{"x-config"})
2421+
assert.DeepEqual(t, p.NetworkNames(), []string{"x-network"})
24062422
}
24072423

24082424
func TestLoadWithInclude(t *testing.T) {

0 commit comments

Comments
 (0)