Esempio n. 1
0
		Context("when the namespace isnt already in the slice", func() {
			It("adds the namespace", func() {
				ns := specs.LinuxNamespace{Type: "potato", Path: "pan"}
				nsl := goci.NamespaceSlice{}
				nsl = nsl.Set(ns)
				Expect(nsl).To(ConsistOf(ns))
			})
		})

		Context("when the namespace is already in the slice", func() {
			It("overrides the namespace", func() {
				ns := specs.LinuxNamespace{Type: "potato", Path: "pan"}
				nsl := goci.NamespaceSlice{specs.LinuxNamespace{Type: "potato", Path: "chips"}}
				nsl = nsl.Set(ns)
				Expect(nsl).To(ConsistOf(ns))
			})
		})
	})

	Describe("WithMaskedPaths", func() {
		It("sets the MaskedPaths in the bundle", func() {
			returnedBundle := initialBundle.WithMaskedPaths([]string{"path1", "path2"})
			paths := returnedBundle.MaskedPaths()
			Expect(len(paths)).To(Equal(2))
			Expect(paths[0]).To(Equal("path1"))
			Expect(paths[1]).To(Equal("path2"))
		})
	})

})