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

Remove test_mode in lib/reline.

This commit is contained in:
manga_osyo 2019-07-15 01:32:17 +09:00 committed by aycabta
parent 9c0cd6a09e
commit f60e5a1f99
2 changed files with 12 additions and 7 deletions

View file

@ -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)

View file

@ -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'])