diff --git a/test/reline/test_history.rb b/test/reline/test_history.rb index 849e50cb0a..90badb38c7 100644 --- a/test/reline/test_history.rb +++ b/test/reline/test_history.rb @@ -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 diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb index f607b7496f..063e6f2ae4 100644 --- a/test/reline/test_key_actor_emacs.rb +++ b/test/reline/test_key_actor_emacs.rb @@ -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') diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb index c6cd5eff48..fed5245bec 100644 --- a/test/reline/test_key_actor_vi.rb +++ b/test/reline/test_key_actor_vi.rb @@ -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) diff --git a/test/reline/test_macro.rb b/test/reline/test_macro.rb index b97de88a97..ab9f09bc7b 100644 --- a/test/reline/test_macro.rb +++ b/test/reline/test_macro.rb @@ -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) diff --git a/test/reline/test_string_processing.rb b/test/reline/test_string_processing.rb index 0e0ee9cc04..4a351f58d6 100644 --- a/test/reline/test_string_processing.rb +++ b/test/reline/test_string_processing.rb @@ -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) diff --git a/test/reline/test_unicode.rb b/test/reline/test_unicode.rb index 8b28cf1cee..08f8197cef 100644 --- a/test/reline/test_unicode.rb +++ b/test/reline/test_unicode.rb @@ -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 diff --git a/test/reline/test_within_pipe.rb b/test/reline/test_within_pipe.rb index 8cf527eaf5..9a2d61c92b 100644 --- a/test/reline/test_within_pipe.rb +++ b/test/reline/test_within_pipe.rb @@ -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