aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormanga_osyo <manga.osyo@gmail.com>2019-07-15 01:32:17 +0900
committeraycabta <aycabta@gmail.com>2019-08-27 01:23:10 +0900
commitf60e5a1f99088849fdc8ddfa84d594179c197a54 (patch)
tree669e073c13a53ed0e98232aebb2ba470fc8cc97d
parent9c0cd6a09eff793356ddc65a76b3fc72c61fee05 (diff)
downloadruby-f60e5a1f99088849fdc8ddfa84d594179c197a54.tar.gz
Remove test_mode in `lib/reline`.
-rw-r--r--lib/reline.rb7
-rw-r--r--test/reline/helper.rb12
2 files changed, 12 insertions, 7 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index aefcf7a5b5..6a53321a6d 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -179,13 +179,6 @@ module Reline
@@line_editor&.delete_text(start, length)
end
- private_class_method def self.test_mode
- remove_const('IOGate') if const_defined?('IOGate')
- const_set('IOGate', Reline::GeneralIO)
- @@config.instance_variable_set(:@test_mode, true)
- @@config.reset
- end
-
def self.input=(val)
raise TypeError unless val.respond_to?(:getc) or val.nil?
if val.respond_to?(:getc)
diff --git a/test/reline/helper.rb b/test/reline/helper.rb
index 714142c054..3cec45b94d 100644
--- a/test/reline/helper.rb
+++ b/test/reline/helper.rb
@@ -1,7 +1,19 @@
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'reline'
+require 'reline2'
require 'test/unit'
+module Reline
+ class <<self
+ def test_mode
+ remove_const('IOGate') if const_defined?('IOGate')
+ const_set('IOGate', Reline::GeneralIO)
+ @@config.instance_variable_set(:@test_mode, true)
+ @@config.reset
+ end
+ end
+end
+
RELINE_TEST_ENCODING ||=
if ENV['RELINE_TEST_ENCODING']
Encoding.find(ENV['RELINE_TEST_ENCODING'])