コード例 #1
0
ファイル: bundle_test.go プロジェクト: cloudfoundry/guardian
		It("sets the CWD to / by default", func() {
			returnedBundle := initialBundle.WithProcess(goci.Process("echo", "foo"))
			Expect(returnedBundle.Process()).To(Equal(specs.Process{Args: []string{"echo", "foo"}}))
		})

		It("does not modify the initial bundle", func() {
			returnedBundle := initialBundle.WithProcess(goci.Process("echo", "foo"))
			Expect(returnedBundle).NotTo(Equal(initialBundle))
		})
	})

	Describe("WithRootFS", func() {
		It("sets the rootfs path in the spec", func() {
			returnedBundle := initialBundle.WithRootFS("/foo/bar/baz")
			Expect(returnedBundle.RootFS()).To(Equal("/foo/bar/baz"))
		})
	})

	Describe("WithPrestartHooks", func() {
		It("adds the hook to the runtime spec", func() {
			returnedBundle := initialBundle.WithPrestartHooks(specs.Hook{
				Path: "foo",
				Args: []string{"bar", "baz"},
			})

			Expect(returnedBundle.PrestartHooks()).To(Equal([]specs.Hook{{
				Path: "foo",
				Args: []string{"bar", "baz"},
			}}))
		})