summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2023-10-01 02:56:00 +0900
committergit <svn-admin@ruby-lang.org>2023-09-30 17:56:06 +0000
commitc9e28ea2f9d442f5efd2a2671ff81cd4308dcde2 (patch)
treea867b19b4d6c83714c74070fbf3b02248c41f34a
parent4c8fac07417d8724e55deb0b55376634fb0d56bc (diff)
[ruby/irb] Fix Reline's test failure running with `make test-all
TESTS='reline irb'` (https://github.com/ruby/irb/pull/722) * Specify TestInputMethod in test to avoid RelineInputMethod to be used * Reset Reline in teardown to avoid test failure of `make test-all TESTS="irb reline"` https://github.com/ruby/irb/commit/5d67967eb1
-rw-r--r--test/irb/test_context.rb2
-rw-r--r--test/irb/test_input_method.rb2
-rw-r--r--test/irb/test_irb.rb2
-rw-r--r--test/irb/test_ruby_lex.rb2
4 files changed, 5 insertions, 3 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb
index f59a23a99d..34bceea54f 100644
--- a/test/irb/test_context.rb
+++ b/test/irb/test_context.rb
@@ -91,7 +91,7 @@ module TestIRB
end
def test_prompt_n_deprecation
- irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new))
+ irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), TestInputMethod.new)
_, err = capture_output do
irb.context.prompt_n = "foo"
diff --git a/test/irb/test_input_method.rb b/test/irb/test_input_method.rb
index ea7efb5dd5..b516be5e3c 100644
--- a/test/irb/test_input_method.rb
+++ b/test/irb/test_input_method.rb
@@ -15,6 +15,8 @@ module TestIRB
def teardown
IRB.conf.replace(@conf_backup)
restore_encodings
+ # Reset Reline configuration overrided by RelineInputMethod.
+ Reline.instance_variable_set(:@core, nil)
end
def test_initialization
diff --git a/test/irb/test_irb.rb b/test/irb/test_irb.rb
index 0c77bb0f76..4e5a94b1be 100644
--- a/test/irb/test_irb.rb
+++ b/test/irb/test_irb.rb
@@ -738,7 +738,7 @@ module TestIRB
workspace = IRB::WorkSpace.new(TOPLEVEL_BINDING.dup)
IRB.conf[:VERBOSE] = false
- IRB::Irb.new(workspace)
+ IRB::Irb.new(workspace, TestInputMethod.new)
end
end
end
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index 09344e1b0e..b9e55c7330 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -222,7 +222,7 @@ module TestIRB
end
IRB.conf[:VERBOSE] = false
- IRB::Context.new(nil, workspace)
+ IRB::Context.new(nil, workspace, TestInputMethod.new)
end
def assert_indent_level(lines, expected, local_variables: [])