var dialError = errors.New("woops") BeforeEach(func() { fakeSecureDialer.DialReturns(nil, dialError) }) It("returns the dial error", func() { Expect(connectErr).To(Equal(dialError)) Expect(fakeSecureDialer.DialCallCount()).To(Equal(1)) }) }) }) }) Describe("InteractiveSession", func() { var opts *options.SSHOptions var sessionError error var interactiveSessionInvoker func(secureShell sshCmd.SecureShell) BeforeEach(func() { sshEndpoint = "ssh.example.com:22" opts = &options.SSHOptions{ AppName: "app-name", Index: 2, } currentApp.State = "STARTED" currentApp.Diego = true currentApp.Guid = "app-guid" token = "bearer token"
var dialError = errors.New("woops") BeforeEach(func() { fakeSecureDialer.DialReturns(nil, dialError) }) It("returns the dial error", func() { Expect(connectErr).To(Equal(dialError)) Expect(fakeSecureDialer.DialCallCount()).To(Equal(1)) }) }) }) }) Describe("InteractiveSession", func() { var opts *options.SSHOptions var sessionError error var interactiveSessionInvoker func(secureShell sshCmd.SecureShell) BeforeEach(func() { sshEndpoint = "ssh.example.com:22" opts = &options.SSHOptions{ AppName: "app-name", Index: 2, } currentApp.State = "STARTED" currentApp.Diego = true currentApp.GUID = "app-guid" token = "bearer token"