Esempio n. 1
0
				It("outputs incorrect usage", func() {
					terminalUI.SayIncorrectUsage("")
					Expect(outputBuffer).To(test_helpers.SayIncorrectUsage())
				})
			})
			Context("when a message is passed", func() {
				It("outputs incorrect usage with the message", func() {
					terminalUI.SayIncorrectUsage("You did that thing wrong")
					Expect(outputBuffer).To(test_helpers.Say("Incorrect Usage: You did that thing wrong"))
				})
			})
		})

		Describe("SayNewLine", func() {
			It("says a newline", func() {
				terminalUI.SayNewLine()
				Expect(outputBuffer).To(test_helpers.SayNewLine())
			})
		})
	})

	Describe("Input Methods", func() {
		Describe("Prompt", func() {
			It("Prompts the user for input", func() {
				answerChan := make(chan string)
				go func() {
					defer GinkgoRecover()

					answerChan <- terminalUI.Prompt("Nickname")
					close(answerChan)
				}()