summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2021-01-19 00:14:12 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2021-01-19 00:14:48 -0800
commite6af81bde166f8714a835d768363fa8de6426885 (patch)
tree000e8139b98e5f76c209f6b8364fb63edf6576a5 /test/irb
parent4da4ad69bb7aa3dd011786834c6584bf88e0282a (diff)
[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
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_color.rb2
-rw-r--r--test/irb/test_context.rb11
2 files changed, 11 insertions, 2 deletions
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
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
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
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