Example #1
0
		})

		It("returns an error", func() {
			_, err := env.Application()
			Expect(err).To(HaveOccurred())
			Expect(err.Error()).To(ContainSubstring("Error parsing VCAP_APPLICATION"))
		})
	})
})

var _ = Describe("App", func() {
	Describe(".URI", func() {
		var app env.App

		BeforeEach(func() {
			app.URIs = []string{"uri1", "uri2", "uri3"}
		})

		It("returns the first URI from the list of URIs", func() {
			Expect(app.URI()).To(Equal("uri1"))
		})

		Context("when the app does have an empty list of URIs", func() {
			BeforeEach(func() {
				app.URIs = []string{}
			})

			It("returns an empty string", func() {
				Expect(app.URI()).To(Equal(""))
			})
		})