Browse code

Add acceptance test for initial query

John Hawthorn authored on 08/02/2017 02:31:42
Showing 1 changed files

... ...
@@ -271,6 +271,18 @@ class FzyTest < Minitest::Test
271 271
     @tty.assert_matches "> 34\n34\n340\n341"
272 272
   end
273 273
 
274
+  def test_initial_query
275
+    @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -q fo})
276
+    @tty.assert_matches "> fo\nfoo"
277
+    @tty.send_keys("o")
278
+    @tty.assert_matches "> foo\nfoo"
279
+    @tty.send_keys("o")
280
+    @tty.assert_matches "> fooo"
281
+
282
+    @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -q asdf})
283
+    @tty.assert_matches "> asdf"
284
+  end
285
+
274 286
   def test_help
275 287
     @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
276 288
     @tty.assert_matches <<TTY