Expect(spec.Properties).To(HaveLen(2)) Expect(spec.Properties["concourse:volumes"]).To(MatchJSON( `["some-dst-base-volume","some-dst-other-base-volume","cow-input-volume","cow-other-input-volume"]`, )) Expect(spec.Properties["concourse:volume-mounts"]).To(MatchJSON( `{"some-dst-base-volume":"/tmp/dst","some-dst-other-base-volume":"/tmp/dst/other","cow-input-volume":"/tmp/dst/path","cow-other-input-volume":"/tmp/dst/other/path"}`, )) }) Context("after the container is created", func() { BeforeEach(func() { fakeGardenClient.CreateStub = func(garden.ContainerSpec) (garden.Container, error) { // ensure they're not released before container creation Expect(cowInputVolume.ReleaseCallCount()).To(Equal(0)) Expect(cowOtherInputVolume.ReleaseCallCount()).To(Equal(0)) return fakeContainer, nil } }) It("releases the copy-on-write volumes that it made beforehand", func() { Expect(cowInputVolume.ReleaseCallCount()).To(Equal(1)) Expect(cowOtherInputVolume.ReleaseCallCount()).To(Equal(1)) }) It("releases the Garden workaround base volumes", func() { Expect(someDstBaseVolume.ReleaseCallCount()).To(Equal(1)) Expect(someDstOtherBaseVolume.ReleaseCallCount()).To(Equal(1)) }) })