reqs := cmd.Requirements(requirementsFactory, flagContext) err := testcmd.RunRequirements(reqs) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage")) Expect(err.Error()).To(ContainSubstring("No argument required")) }) }) }) Describe("when logged in", func() { BeforeEach(func() { requirementsFactory.LoginSuccess = true environmentVariableGroupRepo.ListStagingReturns( []models.EnvironmentVariable{ {Name: "abc", Value: "123"}, {Name: "def", Value: "456"}, }, nil) }) It("Displays the staging environment variable group", func() { runCommand() Expect(ui.Outputs).To(ContainSubstrings( []string{"Retrieving the contents of the staging environment variable group as my-user..."}, []string{"OK"}, []string{"Variable Name", "Assigned Value"}, []string{"abc", "123"}, []string{"def", "456"}, )) })