fakeFirehose.Start() fakeCliConnection = &pluginfakes.FakeCliConnection{} fakeCliConnection.AccessTokenReturns(ACCESS_TOKEN, nil) fakeCliConnection.DopplerEndpointReturns(fakeFirehose.URL(), nil) nozzlerCmd = &NozzlerCmd{} }) AfterEach(func() { fakeFirehose.Close() }) Context("when invoked via 'app-nozzle'", func() { Context("when app name is not recognized", func() { BeforeEach(func() { fakeCliConnection.GetAppReturns(plugin_models.GetAppModel{}, errors.New("App not found")) }) It("returns error message", func(done Done) { defer close(done) outputChan := make(chan []string) go func() { output := io_helpers.CaptureOutput(func() { nozzlerCmd.Run(fakeCliConnection, []string{"app-nozzle", "IDontExist"}) }) outputChan <- output }() var output []string Eventually(outputChan, 2).Should(Receive(&output)) outputString := strings.Join(output, "|")