} //set rpc.GetOutputAndReset to return empty string; this is used by CliCommand()/CliWithoutTerminalOutput() rpcHandlers.GetOutputAndResetStub = func(_ bool, retVal *[]string) error { *retVal = []string{"{}"} return nil } }) JustBeforeEach(func() { err = ts.Start() Expect(err).NotTo(HaveOccurred()) }) AfterEach(func() { ts.Stop() }) Describe("list-apps", func() { Context("Option flags", func() { It("accept --started or --stopped as valid optional flag", func() { args := []string{ts.Port(), "list-apps", "--started"} session, err := gexec.Start(exec.Command(validPluginPath, args...), GinkgoWriter, GinkgoWriter) session.Wait() Expect(err).NotTo(HaveOccurred()) args = []string{ts.Port(), "list-apps", "--stopped"} session, err = gexec.Start(exec.Command(validPluginPath, args...), GinkgoWriter, GinkgoWriter) session.Wait() Expect(err).NotTo(HaveOccurred()) })