diff options
author | Ana María Martínez Gómez <anamaria@martinezgomez.name> | 2019-04-07 08:20:00 +0200 |
---|---|---|
committer | Ana María Martínez Gómez <anamaria@martinezgomez.name> | 2019-04-08 16:28:52 +0200 |
commit | c553fbe9db01a1b969aa06bd609149daac736fb3 (patch) | |
tree | d43b416e2aa7b32e0aeaaa993a323c1e5e3b323b /test | |
parent | 1c9a9a3a9f19b9a97d3650f206acb0e9800611b7 (diff) | |
download | highline-c553fbe9db01a1b969aa06bd609149daac736fb3.tar.gz |
Add tests and documentation for capital_letter
We didn't have time for this during the The Biggest Mobprogramming
session ever at RubyConfBY 2019: https://rubyconference.by
@dmitriy-kiriyenko implemented it in
https://github.com/JEG2/highline/pull/242, so I cherry-picked it from
there.
Co-authored-by: Dmitriy Kiriyenko <dmitriy.kiriyenko@gmail.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_menu.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_menu.rb b/test/test_menu.rb index 6278c7c..2a8cbaf 100755 --- a/test/test_menu.rb +++ b/test/test_menu.rb @@ -539,6 +539,19 @@ class TestMenu < Minitest::Test assert_equal(:load, selected) end + def test_select_by_capital_letter + @input << "B\n" + @input.rewind + + selected = @terminal.choose do |menu| + menu.index = :capital_letter + menu.choice :save + menu.choice :load + menu.choice :quit + end + assert_equal(:load, selected) + end + def test_shell @input << "save --some-option my_file.txt\n" @input.rewind |