Skip to content

Commit

Permalink
Use 24x80 size in test
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Oct 25, 2023
1 parent e703d15 commit 5282482
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion test/reline/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ def test_mode(ansi: false)
else
encoding = Encoding::UTF_8
end
@original_get_screen_size = IOGate.method(:get_screen_size)
IOGate.singleton_class.remove_method(:get_screen_size)
def IOGate.get_screen_size
[24, 80]
end
Reline::GeneralIO.reset(encoding: encoding) unless ansi
core.config.instance_variable_set(:@test_mode, true)
core.config.reset
Reline.line_editor.instance_variable_set(:@screen_size, [24, 80])
end

def test_reset
IOGate.singleton_class.remove_method(:get_screen_size)
IOGate.define_singleton_method(:get_screen_size, @original_get_screen_size)
remove_const('IOGate')
const_set('IOGate', @original_iogate)
Reline::GeneralIO.reset
Expand Down
1 change: 0 additions & 1 deletion test/reline/test_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def setup
@config = Reline::Config.new
@encoding = Reline.core.encoding
@line_editor = Reline::LineEditor.new(@config, @encoding)
@line_editor.instance_variable_set(:@screen_size, [24, 80])
@output = @line_editor.output = File.open(IO::NULL, "w")
end

Expand Down

0 comments on commit 5282482

Please sign in to comment.