Skip to content

Commit

Permalink
[#78596198] add test for error branch of ui.Ask
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Zhylinski committed Nov 18, 2014
1 parent 35bd4b9 commit 83cb998
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cf/terminal/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ var _ = Describe("UI", func() {
Expect(ui.Ask("?")).To(Equal("foo bar"))
})
})

It("returns empty string if an error occured while reading string", func() {
io_helpers.SimulateStdin("string without expected delimiter", func(reader io.Reader) {
ui := NewUI(reader, NewTeePrinter())
Expect(ui.Ask("?")).To(Equal(""))
})
})
})

Describe("Confirming user input", func() {
Expand Down

0 comments on commit 83cb998

Please sign in to comment.