return testcmd.RunCommand(cmd, args, requirementsFactory) } Describe("requirements", func() { It("requires the user to be logged in", func() { requirementsFactory.LoginSuccess = false Expect(runCommand()).ToNot(HavePassedRequirements()) }) }) Describe("when logged in", func() { BeforeEach(func() { requirementsFactory.LoginSuccess = true environmentVariableGroupRepo.ListRunningReturns( []models.EnvironmentVariable{ models.EnvironmentVariable{Name: "abc", Value: "123"}, models.EnvironmentVariable{Name: "def", Value: "456"}, }, nil) }) It("Displays the running environment variable group", func() { runCommand() Expect(ui.Outputs).To(ContainSubstrings( []string{"Retrieving the contents of the running environment variable group as my-user..."}, []string{"OK"}, []string{"Variable Name", "Assigned Value"}, []string{"abc", "123"}, []string{"def", "456"}, )) })