opts = &options.SSHOptions{ AppName: "app-1", ForwardSpecs: []options.ForwardSpec{{ ListenAddress: localAddress, ConnectAddress: echoAddress, }}, } fakeAppFactory.GetReturns(app.App{ State: "STARTED", Diego: true, }, nil) fakeInfoFactory.GetReturns(info.Info{}, nil) fakeCredFactory.GetReturns(credential.Credential{}, nil) fakeSecureClient.DialStub = net.Dial }) JustBeforeEach(func() { connectErr := secureShell.Connect(opts) Expect(connectErr).NotTo(HaveOccurred()) localForwardError = secureShell.LocalPortForward() }) AfterEach(func() { err := secureShell.Close() Expect(err).NotTo(HaveOccurred()) echoServer.Shutdown() realLocalListener.Close()