aboutsummaryrefslogtreecommitdiffstats
path: root/test/reline
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 /test/reline
parent9c0cd6a09eff793356ddc65a76b3fc72c61fee05 (diff)
downloadruby-f60e5a1f99088849fdc8ddfa84d594179c197a54.tar.gz
Remove test_mode in `lib/reline`.
Diffstat (limited to 'test/reline')
-rw-r--r--test/reline/helper.rb12
1 files changed, 12 insertions, 0 deletions
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'])