summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_menu.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/test_menu.rb b/test/test_menu.rb
index d944794..f870245 100644
--- a/test/test_menu.rb
+++ b/test/test_menu.rb
@@ -86,10 +86,8 @@ class TestMenu < Minitest::Test
@input.rewind
selected = @terminal.choose do |menu|
- item1 = HighLine::Menu::MenuItem.new(name: "Sample1", text: "Sample2")
- item2 = HighLine::Menu::MenuItem.new(name: "Sample2", text: "Sample1")
- menu.choice(item1)
- menu.choice(item2)
+ menu.choice("Sample1", nil, "Sample2")
+ menu.choice("Sample2", nil, "Sample1")
end
assert_equal(selected, "Sample1")
assert_equal("1. Sample2\n" +
@@ -102,10 +100,8 @@ class TestMenu < Minitest::Test
@input.rewind
selected = @terminal.choose do |menu|
- item1 = HighLine::Menu::MenuItem.new(name: "Sample1", text: "Sample2")
- item2 = HighLine::Menu::MenuItem.new(name: "Sample2", text: "Sample1")
- menu.choice(item1)
- menu.choice(item2)
+ menu.choice("Sample1", nil, "Sample2")
+ menu.choice("Sample2", nil, "Sample1")
end
assert_equal(selected, "Sample2")
assert_equal("1. Sample2\n" +