aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb/test_cmd.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-11-19 21:05:45 -0800
committergit <svn-admin@ruby-lang.org>2022-11-20 05:06:07 +0000
commite0f0367ab5d3504e741bd6b89d6eea7c93a94327 (patch)
tree6d7a51c18f1107996745e60b642c0e9fc87a04cf /test/irb/test_cmd.rb
parent180ed611b238db48db9feb1449c4e3b563d2dce0 (diff)
downloadruby-e0f0367ab5d3504e741bd6b89d6eea7c93a94327.tar.gz
[ruby/irb] Fix CI failure on ruby/ruby
https://github.com/ruby/irb/commit/ea8c716922
Diffstat (limited to 'test/irb/test_cmd.rb')
-rw-r--r--test/irb/test_cmd.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index 44f348a724..99d47f1828 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -5,7 +5,24 @@ require "irb/extend-command"
require_relative "helper"
module TestIRB
- class ExtendCommandTest < TestCase
+ class CommandTestCase < TestCase
+ def execute_lines(*lines, conf: {}, main: self, irb_path: nil)
+ IRB.init_config(nil)
+ IRB.conf[:VERBOSE] = false
+ IRB.conf[:PROMPT_MODE] = :SIMPLE
+ IRB.conf.merge!(conf)
+ input = TestInputMethod.new(lines)
+ irb = IRB::Irb.new(IRB::WorkSpace.new(main), input)
+ irb.context.return_format = "=> %s\n"
+ irb.context.irb_path = irb_path if irb_path
+ IRB.conf[:MAIN_CONTEXT] = irb.context
+ capture_output do
+ irb.eval_input
+ end
+ end
+ end
+
+ class ExtendCommandTest < CommandTestCase
def setup
@pwd = Dir.pwd
@tmpdir = File.join(Dir.tmpdir, "test_reline_config_#{$$}")
@@ -565,7 +582,7 @@ module TestIRB
$bar = nil
end
- class EditTest < ExtendCommandTest
+ class EditTest < CommandTestCase
def setup
@original_editor = ENV["EDITOR"]
# noop the command so nothing gets executed
@@ -639,22 +656,5 @@ module TestIRB
assert_match("command: ': code'", out)
end
end
-
- private
-
- def execute_lines(*lines, conf: {}, main: self, irb_path: nil)
- IRB.init_config(nil)
- IRB.conf[:VERBOSE] = false
- IRB.conf[:PROMPT_MODE] = :SIMPLE
- IRB.conf.merge!(conf)
- input = TestInputMethod.new(lines)
- irb = IRB::Irb.new(IRB::WorkSpace.new(main), input)
- irb.context.return_format = "=> %s\n"
- irb.context.irb_path = irb_path if irb_path
- IRB.conf[:MAIN_CONTEXT] = irb.context
- capture_output do
- irb.eval_input
- end
- end
end
end