mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Call Reline.test_reset in teardown definitely
This commit is contained in:
parent
9498ea9385
commit
af19f9a6e9
7 changed files with 23 additions and 0 deletions
|
@ -6,6 +6,10 @@ class Reline::History::Test < Reline::TestCase
|
|||
Reline.send(:test_mode)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_ancestors
|
||||
assert_equal(Reline::History.ancestors.include?(Array), true)
|
||||
end
|
||||
|
|
|
@ -12,6 +12,10 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
|
|||
@line_editor.reset(@prompt, encoding: @encoding)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_ed_insert_one
|
||||
input_keys('a')
|
||||
assert_line('a')
|
||||
|
|
|
@ -13,6 +13,10 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
|
|||
@line_editor.reset(@prompt, encoding: @encoding)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_vi_command_mode
|
||||
input_keys("\C-[")
|
||||
assert_instance_of(Reline::KeyActor::ViCommand, @config.editing_mode)
|
||||
|
|
|
@ -2,6 +2,7 @@ require_relative 'helper'
|
|||
|
||||
class Reline::MacroTest < Reline::TestCase
|
||||
def setup
|
||||
Reline.send(:test_mode)
|
||||
@config = Reline::Config.new
|
||||
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
|
||||
@line_editor = Reline::LineEditor.new(@config, @encoding)
|
||||
|
@ -11,6 +12,7 @@ class Reline::MacroTest < Reline::TestCase
|
|||
|
||||
def teardown
|
||||
@output.close
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def input_key(char, combined_char = char, with_meta = false)
|
||||
|
|
|
@ -11,6 +11,10 @@ class Reline::LineEditor::StringProcessingTest < Reline::TestCase
|
|||
@line_editor.reset(@prompt, encoding: @encoding)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_calculate_width
|
||||
width = @line_editor.send(:calculate_width, 'Ruby string')
|
||||
assert_equal('Ruby string'.size, width)
|
||||
|
|
|
@ -6,6 +6,10 @@ class Reline::Unicode::Test < Reline::TestCase
|
|||
Reline.send(:test_mode)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_get_mbchar_width
|
||||
assert_equal Reline.ambiguous_width, Reline::Unicode.get_mbchar_width('é')
|
||||
end
|
||||
|
|
|
@ -23,6 +23,7 @@ class Reline::WithinPipeTest < Reline::TestCase
|
|||
@output_writer.close
|
||||
@config.reset
|
||||
@config.reset_default_key_bindings
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
def test_simple_input
|
||||
|
|
Loading…
Reference in a new issue