Skip to content

Commit

Permalink
Add yamatanooroti rendering test
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Mar 21, 2020
1 parent bce7e75 commit f092519
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENCODING_LIST.each_pair do |task_name, encoding|
t.libs << 'test'
t.libs << 'lib'
t.loader = :direct
t.pattern = 'test/reline/**/test_*.rb'
t.pattern = 'test/reline/test_*.rb'
end
end

Expand Down
37 changes: 37 additions & 0 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
begin
require 'yamatanooroti'

class Yamatanooroti::TestMultiplatform < Yamatanooroti::TestCase
def setup
inputrc_backup = ENV['INPUTRC']
ENV['INPUTRC'] = 'nonexistent_file'
start_terminal(5, 30, %w{ruby -Ilib bin/multiline_repl})
sleep 0.5
ENV['INPUTRC'] = inputrc_backup
end

def test_history_back
write(":a\n")
write("\C-p")
close
assert_screen(<<~EOC)
Multiline REPL.
prompt> :a
=> :a
prompt> :a
EOC
end

def test_backspace
write(":abc\C-h\n")
close
assert_screen(<<~EOC)
Multiline REPL.
prompt> :ab
=> :ab
prompt>
EOC
end
end
rescue LoadError, NameError # yamatanooroti gem not found
end

0 comments on commit f092519

Please sign in to comment.