From 8e06a54b1c6b53442d6fa47e1614c4b144fbd734 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Tue, 24 Jan 2017 22:49:21 -0700 Subject: [PATCH] Add test for string with "\n" in it --- spec/strategies/default_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/strategies/default_spec.rb b/spec/strategies/default_spec.rb index 36a1221..1b6a4a2 100644 --- a/spec/strategies/default_spec.rb +++ b/spec/strategies/default_spec.rb @@ -46,6 +46,20 @@ describe 'default strategy' do end end + context 'with a newline hist entry' do + before do + session.send_string('echo "\n"') + session.send_keys('enter') + + session.clear + end + + it do + session.send_keys('e') + wait_for { session.content }.to eq 'echo "\n"' + end + end + context 'with a hist entry with a backslash' do before do session.run_command('echo "hello\nworld"')