ruby-changes:64956
From: Takashi <ko1@a...>
Date: Tue, 19 Jan 2021 16:36:24 +0900 (JST)
Subject: [ruby-changes:64956] b2159f7c38 (master): [ruby/irb] Stub a screen size for tests
https://git.ruby-lang.org/ruby.git/commit/?id=b2159f7c38 From b2159f7c38262f5d0746a3cfb9b33ea9d62ed813 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Mon, 18 Jan 2021 23:35:31 -0800 Subject: [ruby/irb] Stub a screen size for tests https://github.com/ruby/irb/commit/6663057083 diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index d035e44..4598021 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -18,6 +18,21 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L18 MAGENTA = "\e[35m" 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 + [36, 80] + end + end + + 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 # Common behaviors. Warn parser error, but do not warn compile error. tests = { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/