ruby-changes:64958
From: Takashi <ko1@a...>
Date: Tue, 19 Jan 2021 17:15:18 +0900 (JST)
Subject: [ruby-changes:64958] e6af81bde1 (master): [ruby/irb] Stub a screen size for test_context
https://git.ruby-lang.org/ruby.git/commit/?id=e6af81bde1 From e6af81bde166f8714a835d768363fa8de6426885 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Tue, 19 Jan 2021 00:14:12 -0800 Subject: [ruby/irb] Stub a screen size for test_context http://ci.rvm.jp/logfiles/brlog.trunk-random1.20210119-074232 https://github.com/ruby/irb/commit/ea87592d4a diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 4598021..50dfc22 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -19,7 +19,6 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L19 CYAN = "\e[36m" def setup - super @get_screen_size = Reline.method(:get_screen_size) Reline.instance_eval { undef :get_screen_size } def Reline.get_screen_size @@ -30,7 +29,6 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L29 def teardown Reline.instance_eval { undef :get_screen_size } Reline.define_singleton_method(:get_screen_size, @get_screen_size) - super end def test_colorize_code diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 2dba42d..63e71e5 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -42,6 +42,17 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_context.rb#L42 IRB.conf[:VERBOSE] = false workspace = IRB::WorkSpace.new(Object.new) @context = IRB::Context.new(nil, workspace, TestInputMethod.new) + + @get_screen_size = Reline.method(:get_screen_size) + Reline.instance_eval { undef :get_screen_size } + def Reline.get_screen_size + [36, 80] + end + end + + def teardown + Reline.instance_eval { undef :get_screen_size } + Reline.define_singleton_method(:get_screen_size, @get_screen_size) end def test_last_value -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/