Example #1
0
		JustBeforeEach(func() {
			connectErr = secureShell.Connect(opts)
		})

		Context("when there is an error getting the app model", func() {
			BeforeEach(func() {
				fakeAppFactory.GetReturns(app.App{}, errors.New("woops"))
			})

			It("returns the error", func() {
				Expect(fakeAppFactory.GetCallCount()).To(Equal(1))
				Expect(connectErr).To(Equal(errors.New("woops")))
			})

			It("does not attempt to acquire endpoint info", func() {
				Expect(fakeInfoFactory.GetCallCount()).To(Equal(0))
			})
		})

		Context("when the app model is successfully acquired", func() {
			BeforeEach(func() {
				fakeAppFactory.GetReturns(app.App{}, nil)
				fakeInfoFactory.GetReturns(info.Info{}, nil)
			})

			It("gets the ssh endpoint information", func() {
				Expect(fakeInfoFactory.GetCallCount()).To(Equal(1))
			})

			Context("when getting the endpoint info fails", func() {
				BeforeEach(func() {