From 5eba69d32ee76e2ce93a7ce017b6f00b31ee1cbb Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 7 Feb 2017 18:21:44 -0800 Subject: Add acceptance test for --show-scores --- test/acceptance/acceptance_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/acceptance') 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 <