Пример #1
0
			fakeAppFactory.GetReturns(app.App{
				State: "STARTED",
				Diego: true,
			}, nil)
			fakeInfoFactory.GetReturns(info.Info{}, nil)
			fakeCredFactory.GetReturns(credential.Credential{}, nil)
		})

		JustBeforeEach(func() {
			connectErr := secureShell.Connect(opts)
			Expect(connectErr).NotTo(HaveOccurred())
		})

		It("calls close on the secureClient", func() {
			err := secureShell.Wait()
			Expect(err).NotTo(HaveOccurred())

			Expect(fakeSecureClient.WaitCallCount()).To(Equal(1))
		})
	})

	Describe("Close", func() {
		var opts *options.SSHOptions

		BeforeEach(func() {
			opts = &options.SSHOptions{
				AppName: "app-1",
			}

			fakeAppFactory.GetReturns(app.App{
Пример #2
0
				AppName: "app-1",
			}

			fakeAppFactory.GetReturns(app.App{
				State: "STARTED",
				Diego: true,
			}, nil)
			fakeInfoFactory.GetReturns(info.Info{}, nil)
			fakeCredFactory.AuthorizationCodeReturns("", nil)
		})

		JustBeforeEach(func() {
			connectErr := secureShell.Connect(opts)
			Expect(connectErr).NotTo(HaveOccurred())

			waitErr = secureShell.Wait()
		})

		It("calls wait on the secureClient", func() {
			Expect(waitErr).NotTo(HaveOccurred())
			Expect(fakeSecureClient.WaitCallCount()).To(Equal(1))
		})

		Describe("keep alive messages", func() {
			var times []time.Time
			var timesCh chan []time.Time
			var done chan struct{}

			BeforeEach(func() {
				keepAliveDuration = 100 * time.Millisecond