} It("creates a user", func() { runCommand("my-user", "my-password") Expect(ui.Outputs).To(ContainSubstrings( []string{"Creating user", "my-user", "current-user"}, []string{"OK"}, []string{"TIP"}, )) Expect(userRepo.CreateUserUsername).To(Equal("my-user")) }) It("prints a warning when the given user already exists", func() { userRepo.CreateUserExists = true runCommand("my-user", "my-password") Expect(ui.WarnOutputs).To(ContainSubstrings( []string{"already exists"}, )) Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"FAILED"})) }) It("fails when no arguments are passed", func() { runCommand() Expect(ui.FailedWithUsage).To(BeTrue()) })