summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:21:44 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:21:44 -0800
commit5eba69d32ee76e2ce93a7ce017b6f00b31ee1cbb (patch)
treea92ed2480f0e9f5f28f5b5261e5f5392ddbbe07a /test
parentbe504d7b627faab0faa45e4dff4f87259c6bf2ef (diff)
Add acceptance test for --show-scores
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 f0e87d0..52c9afe 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -229,6 +229,22 @@ class FzyTest < Minitest::Test
@tty.assert_matches "foo bar baz"
end
+ def test_show_scores
+ expected_score = '( inf)'
+ @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -s})
+ @tty.send_keys('foo')
+ @tty.assert_matches "> foo\n#{expected_score} foo"
+
+ @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} --show-scores})
+ @tty.send_keys('foo')
+ @tty.assert_matches "> foo\n#{expected_score} foo"
+
+ expected_score = '( 0.89)'
+ @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -s})
+ @tty.send_keys('f')
+ @tty.assert_matches "> f\n#{expected_score} foo"
+ end
+
def test_help
@tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
@tty.assert_matches <<TTY