Exemple #1
0
			Context("when rlimits are set", func() {
				BeforeEach(func() {
					rlimitsEncoder.EncodeLimitsStub = func(limits garden.ResourceLimits) string {
						return "hello=world,name=wsh"
					}
				})

				It("applies the rlimits environment variables", func() {
					Expect(thePreparedCmd.Args).To(ContainElement("-rlimits=hello=world,name=wsh"))
				})
			})

			Context("when a working directory is supplied", func() {
				BeforeEach(func() {
					spec.Dir = "some-dir"
				})

				It("uses the supplied dir", func() {
					Expect(thePreparedCmd.Dir).To(Equal("some-dir"))
				})
			})

			Context("when a working directory is not supplied", func() {

				BeforeEach(func() {
					spec.Dir = ""
				})

				Context("and the user is not root", func() {
					BeforeEach(func() {