summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormatrinox <geofflee21@me.com>2016-01-24 19:03:26 -0800
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2016-02-19 03:57:18 -0300
commite3a65711e5a5073e275ab2a94629a45cb9697a11 (patch)
tree7282dcbfa6a54e48fbdaca781273d62dfb7ca318 /test
parentb47a7d5167b9f0480c2a6771706e3fdddd6965eb (diff)
downloadhighline-e3a65711e5a5073e275ab2a94629a45cb9697a11.tar.gz
Add MenuItem struct for encapsulation
By encapsulating menu items in a struct, it's easier to add more fields like text. Instead of keeping name and text the same, they are now decoupled: user inputs match name while text is what's displayed in the terminal.
Diffstat (limited to 'test')
-rw-r--r--test/test_menu.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_menu.rb b/test/test_menu.rb
index 921e1fd..15d4e50 100644
--- a/test/test_menu.rb
+++ b/test/test_menu.rb
@@ -89,9 +89,9 @@ class TestMenu < Minitest::Test
@terminal.choose do |menu|
menu.shell = true
- menu.choice(:load, "Load a file.")
- menu.choice(:save, "Save data in file.")
- menu.choice(:quit, "Exit program.")
+ menu.choice(:load, help: "Load a file.")
+ menu.choice(:save, help: "Save data in file.")
+ menu.choice(:quit, help: "Exit program.")
menu.help("rules", "The rules of this system are as follows...")
end
@@ -448,7 +448,7 @@ class TestMenu < Minitest::Test
selected = @terminal.choose do |menu|
menu.responses[:ask_on_error] = "> "
menu.prompt = "> "
- menu.choice :exit, "Exit cube editor"
+ menu.choice :exit, help: "Exit cube editor"
end
prompt = "> "