From 5669efa4c1526761d9f1a71c40892738937f5d00 Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Tue, 26 Sep 2023 19:06:13 +0900 Subject: [PATCH] Disable pager in show-source test (#720) --- test/irb/test_cmd.rb | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb index e8c959ec3..fd0a02a7a 100644 --- a/test/irb/test_cmd.rb +++ b/test/irb/test_cmd.rb @@ -23,6 +23,9 @@ def setup save_encodings IRB.instance_variable_get(:@CONF).clear @is_win = (RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/) + STDIN.singleton_class.define_method :tty? do + false + end end def teardown @@ -31,6 +34,7 @@ def teardown Dir.chdir(@pwd) FileUtils.rm_rf(@tmpdir) restore_encodings + STDIN.singleton_class.remove_method :tty? end def execute_lines(*lines, conf: {}, main: self, irb_path: nil) @@ -665,16 +669,6 @@ def test_whereami_alias class ShowCmdsTest < CommandTestCase - def setup - STDIN.singleton_class.define_method :tty? do - false - end - end - - def teardown - STDIN.singleton_class.remove_method :tty? - end - def test_show_cmds out, err = execute_lines( "show_cmds\n" @@ -687,16 +681,6 @@ def test_show_cmds end class LsTest < CommandTestCase - def setup - STDIN.singleton_class.define_method :tty? do - false - end - end - - def teardown - STDIN.singleton_class.remove_method :tty? - end - def test_ls out, err = execute_lines( "class P\n",