blob: 7ff06f5a6b8aec10031edb3a8bd5a7a297a8f557 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# coding: utf-8
require "stringio"
require "tempfile"
#
# On tests, we try to simulate input output with
# StringIO, Tempfile and File objects.
#
# For this to be accomplished, we have to do some
# tweaking so that they respond adequately to the
# called methods during tests.
#
module IOConsoleCompatible
def getch
getc
end
attr_accessor :echo
def winsize
[24, 80]
end
end
class Tempfile
include IOConsoleCompatible
end
class File
include IOConsoleCompatible
end
class StringIO
include IOConsoleCompatible
end
|