File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,19 @@ def test_mode(ansi: false)
2929 else
3030 encoding = Encoding ::UTF_8
3131 end
32+ @original_get_screen_size = IOGate . method ( :get_screen_size )
33+ IOGate . singleton_class . remove_method ( :get_screen_size )
34+ def IOGate . get_screen_size
35+ [ 24 , 80 ]
36+ end
3237 Reline ::GeneralIO . reset ( encoding : encoding ) unless ansi
3338 core . config . instance_variable_set ( :@test_mode , true )
3439 core . config . reset
35- Reline . line_editor . instance_variable_set ( :@screen_size , [ 24 , 80 ] )
3640 end
3741
3842 def test_reset
43+ IOGate . singleton_class . remove_method ( :get_screen_size )
44+ IOGate . define_singleton_method ( :get_screen_size , @original_get_screen_size )
3945 remove_const ( 'IOGate' )
4046 const_set ( 'IOGate' , @original_iogate )
4147 Reline ::GeneralIO . reset
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ def setup
66 @config = Reline ::Config . new
77 @encoding = Reline . core . encoding
88 @line_editor = Reline ::LineEditor . new ( @config , @encoding )
9- @line_editor . instance_variable_set ( :@screen_size , [ 24 , 80 ] )
109 @output = @line_editor . output = File . open ( IO ::NULL , "w" )
1110 end
1211
You can’t perform that action at this time.
0 commit comments