summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:17:41 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:17:41 -0800
commitbe504d7b627faab0faa45e4dff4f87259c6bf2ef (patch)
tree758ed84b8606fc1d654631f5804da89e70a4c09c /test
parent699d03a39957a681dc2ea3cf750399e14df6f94b (diff)
Add acceptance test for --help
Also shorten help to fit 80 characters wide terminal.
Diffstat (limited to 'test')
-rw-r--r--test/acceptance/acceptance_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb
index f5ec243..f0e87d0 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -228,4 +228,20 @@ class FzyTest < Minitest::Test
@tty.send_keys("baz")
@tty.assert_matches "foo bar baz"
end
+
+ def test_help
+ @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
+ @tty.assert_matches <<TTY
+Usage: fzy [OPTION]...
+ -l, --lines=LINES Specify how many lines of results to show (default 10)
+ -p, --prompt=PROMPT Input prompt (default '> ')
+ -q, --query=QUERY Use QUERY as the initial search string
+ -e, --show-matches=QUERY Output the sorted matches of QUERY
+ -t, --tty=TTY Specify file to use as TTY device (default /dev/tty)
+ -s, --show-scores Show the scores of each match
+ -j, --workers NUM Use NUM workers for searching. (default is # of CPUs)
+ -h, --help Display this help and exit
+ -v, --version Output version information and exit
+TTY
+ end
end