Skip to content

Commit

Permalink
add menu default test
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrb committed Jul 11, 2016
1 parent d789f43 commit 813b510
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ def test_choices
assert_equal("Sample2", output)
end

def test_default
@input << "\n"
@input.rewind

output = @terminal.choose do |menu|
menu.choices("Sample1", "Sample2", "Sample3")
menu.default = "Sample1"
end

assert_equal("Sample1", output)
end

def test_flow
@input << "Sample1\n"
@input.rewind
Expand Down

0 comments on commit 813b510

Please sign in to comment.