diff options
author | Frederico <fred.rbittencourt@gmail.com> | 2016-07-11 00:44:00 -0300 |
---|---|---|
committer | Frederico <fred.rbittencourt@gmail.com> | 2016-07-11 00:44:00 -0300 |
commit | 813b510debf9b63aa309b95a8a7857ff12aa9327 (patch) | |
tree | d7191ef1509b605a9ca4598e9aff8f511107bb32 /test | |
parent | d789f437659d8942f272f92b8374c767963db4c4 (diff) | |
download | highline-813b510debf9b63aa309b95a8a7857ff12aa9327.tar.gz |
add menu default test
Diffstat (limited to 'test')
-rw-r--r-- | test/test_menu.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_menu.rb b/test/test_menu.rb index b654ef3..402b47d 100644 --- a/test/test_menu.rb +++ b/test/test_menu.rb @@ -31,6 +31,18 @@ class TestMenu < Minitest::Test 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 |