forked from paketo-buildpacks/occam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cache_volume_names_test.go
38 lines (32 loc) · 1.15 KB
/
cache_volume_names_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package occam_test
import (
"testing"
"github.com/paketo-buildpacks/occam"
"github.com/sclevine/spec"
. "github.com/onsi/gomega"
)
func testCacheVolumeNames(t *testing.T, context spec.G, it spec.S) {
var Expect = NewWithT(t).Expect
it("returns the name of the cache volumes that are assigned to an image", func() {
Expect(occam.CacheVolumeNames("some-app")).To(Equal([]string{
"pack-cache-16fe664c76f0.build",
"pack-cache-some-app_latest-16fe664c76f0.build",
"pack-cache-16fe664c76f0.launch",
"pack-cache-some-app_latest-16fe664c76f0.launch",
"pack-cache-16fe664c76f0.cache",
"pack-cache-some-app_latest-16fe664c76f0.cache",
}))
})
context("when the name includes a registry", func() {
it("returns the name of the cache volumes that are assigned to an image", func() {
Expect(occam.CacheVolumeNames("occam.example.com/some-app")).To(Equal([]string{
"pack-cache-e69d3a4f1e12.build",
"pack-cache-some-app_latest-e69d3a4f1e12.build",
"pack-cache-e69d3a4f1e12.launch",
"pack-cache-some-app_latest-e69d3a4f1e12.launch",
"pack-cache-e69d3a4f1e12.cache",
"pack-cache-some-app_latest-e69d3a4f1e12.cache",
}))
})
})
}