Browse code

add test_show_info acceptance test

Ondrej Martinek authored on 05/04/2019 11:32:19 • John Hawthorn committed on 28/12/2019 07:17:18
Showing 1 changed files

... ...
@@ -447,6 +447,15 @@ class FzyTest < Minitest::Test
447 447
     TTY
448 448
   end
449 449
 
450
+  def test_show_info
451
+    @tty = interactive_fzy(input: %w[foo bar baz], args: "-i")
452
+    @tty.assert_matches ">\n[3/3]\nfoo\nbar\nbaz"
453
+    @tty.send_keys("ba")
454
+    @tty.assert_matches "> ba\n[2/3]\nbar\nbaz"
455
+    @tty.send_keys("q")
456
+    @tty.assert_matches "> baq\n[0/3]"
457
+  end
458
+
450 459
   def test_help
451 460
     @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
452 461
     @tty.assert_matches <<TTY