From cdafcf05b3a0707f99414dad8cac69d8f87d82f0 Mon Sep 17 00:00:00 2001 From: Ondrej Martinek Date: Thu, 21 Mar 2019 13:47:58 +0000 Subject: fix acceptance tests --- test/acceptance/acceptance_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb index ba3ec01..1370ac8 100644 --- a/test/acceptance/acceptance_test.rb +++ b/test/acceptance/acceptance_test.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require 'minitest' require 'minitest/autorun' require 'ttytest' @@ -458,6 +459,7 @@ Usage: fzy [OPTION]... -s, --show-scores Show the scores of each match -0, --read-null Read input delimited by ASCII NUL characters -j, --workers NUM Use NUM workers for searching. (default is # of CPUs) + -i, --show-info Show selection info line -h, --help Display this help and exit -v, --version Output version information and exit TTY -- cgit v1.2.3 From 8505df59ffd9b578f98591520b51abc818509fc3 Mon Sep 17 00:00:00 2001 From: Ondrej Martinek Date: Fri, 5 Apr 2019 11:32:19 +0000 Subject: add test_show_info acceptance test --- test/acceptance/acceptance_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb index 1370ac8..13af803 100644 --- a/test/acceptance/acceptance_test.rb +++ b/test/acceptance/acceptance_test.rb @@ -447,6 +447,15 @@ class FzyTest < Minitest::Test TTY end + def test_show_info + @tty = interactive_fzy(input: %w[foo bar baz], args: "-i") + @tty.assert_matches ">\n[3/3]\nfoo\nbar\nbaz" + @tty.send_keys("ba") + @tty.assert_matches "> ba\n[2/3]\nbar\nbaz" + @tty.send_keys("q") + @tty.assert_matches "> baq\n[0/3]" + end + def test_help @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help}) @tty.assert_matches <