1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use LineEditor#reset on test

This commit is contained in:
aycabta 2019-05-13 00:30:39 +09:00
parent d3a702a3f1
commit 33bce2585f
2 changed files with 4 additions and 6 deletions

View file

@ -4,9 +4,8 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
def setup def setup
@prompt = '> ' @prompt = '> '
@config = Reline::Config.new # Emacs mode is default @config = Reline::Config.new # Emacs mode is default
@line_editor = Reline::LineEditor.new( @line_editor = Reline::LineEditor.new(@config)
@config, @prompt, @line_editor.reset(@prompt, (RELINE_TEST_ENCODING rescue Encoding.default_external))
(RELINE_TEST_ENCODING rescue Encoding.default_external))
@line_editor.retrieve_completion_block = Reline.method(:retrieve_completion_block) @line_editor.retrieve_completion_block = Reline.method(:retrieve_completion_block)
end end

View file

@ -7,9 +7,8 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
@config.read_lines(<<~LINES.split(/(?<=\n)/)) @config.read_lines(<<~LINES.split(/(?<=\n)/))
set editing-mode vi set editing-mode vi
LINES LINES
@line_editor = Reline::LineEditor.new( @line_editor = Reline::LineEditor.new(@config)
@config, @prompt, @line_editor.reset(@prompt, (RELINE_TEST_ENCODING rescue Encoding.default_external))
(RELINE_TEST_ENCODING rescue Encoding.default_external))
@line_editor.retrieve_completion_block = Reline.method(:retrieve_completion_block) @line_editor.retrieve_completion_block = Reline.method(:retrieve_completion_block)
end end