예제 #1
0
			})

			It("returns the error", func() {
				_, err := container.Property(propertyName)
				Ω(err).Should(Equal(disaster))
			})
		})
	})

	Describe("StreamIn", func() {
		It("sends a stream in request", func() {
			fakeConnection.StreamInStub = func(handle string, spec garden.StreamInSpec) error {
				Ω(spec.Path).Should(Equal("to"))
				Ω(spec.User).Should(Equal("frank"))

				content, err := ioutil.ReadAll(spec.TarStream)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(string(content)).Should(Equal("stuff"))

				return nil
			}

			err := container.StreamIn(garden.StreamInSpec{
				User:      "******",
				Path:      "to",
				TarStream: bytes.NewBufferString("stuff"),
			})
			Ω(err).ShouldNot(HaveOccurred())
		})

		Context("when streaming in fails", func() {
			disaster := errors.New("oh no!")