[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
This commit is contained in:
parent
4da4ad69bb
commit
e6af81bde1
@ -19,7 +19,6 @@ module TestIRB
|
|||||||
CYAN = "\e[36m"
|
CYAN = "\e[36m"
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
|
||||||
@get_screen_size = Reline.method(:get_screen_size)
|
@get_screen_size = Reline.method(:get_screen_size)
|
||||||
Reline.instance_eval { undef :get_screen_size }
|
Reline.instance_eval { undef :get_screen_size }
|
||||||
def Reline.get_screen_size
|
def Reline.get_screen_size
|
||||||
@ -30,7 +29,6 @@ module TestIRB
|
|||||||
def teardown
|
def teardown
|
||||||
Reline.instance_eval { undef :get_screen_size }
|
Reline.instance_eval { undef :get_screen_size }
|
||||||
Reline.define_singleton_method(:get_screen_size, @get_screen_size)
|
Reline.define_singleton_method(:get_screen_size, @get_screen_size)
|
||||||
super
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_colorize_code
|
def test_colorize_code
|
||||||
|
@ -42,6 +42,17 @@ module TestIRB
|
|||||||
IRB.conf[:VERBOSE] = false
|
IRB.conf[:VERBOSE] = false
|
||||||
workspace = IRB::WorkSpace.new(Object.new)
|
workspace = IRB::WorkSpace.new(Object.new)
|
||||||
@context = IRB::Context.new(nil, workspace, TestInputMethod.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
|
end
|
||||||
|
|
||||||
def test_last_value
|
def test_last_value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user