File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
test/reline/yamatanooroti Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
class Reline ::TestRendering < Yamatanooroti ::TestCase
7
7
def setup
8
+ @pwd = Dir . pwd
9
+ @tmpdir = File . join ( Dir . tmpdir , "test_reline_config_#{ $$} " )
10
+ begin
11
+ Dir . mkdir ( @tmpdir )
12
+ rescue Errno ::EEXIST
13
+ FileUtils . rm_rf ( @tmpdir )
14
+ Dir . mkdir ( @tmpdir )
15
+ end
16
+ Dir . chdir ( @tmpdir )
8
17
inputrc_backup = ENV [ 'INPUTRC' ]
9
- ENV [ 'INPUTRC' ] = 'nonexistent_file'
10
- start_terminal ( 5 , 30 , %w{ ruby -Ilib bin/multiline_repl } )
18
+ @inputrc_file = ENV [ 'INPUTRC' ] = File . expand_path ( 'temporaty_inputrc' )
19
+ File . unlink ( @inputrc_file ) if File . exist? ( @inputrc_file )
20
+ start_terminal ( 5 , 30 , %W{ ruby -I#{ @pwd } /lib #{ @pwd } /bin/multiline_repl} )
11
21
sleep 0.5
12
22
ENV [ 'INPUTRC' ] = inputrc_backup
13
23
end
14
24
25
+ def teardown
26
+ Dir . chdir ( @pwd )
27
+ FileUtils . rm_rf ( @tmpdir )
28
+ end
29
+
15
30
def test_history_back
16
31
write ( ":a\n " )
17
32
write ( "\C -p" )
You can’t perform that action at this time.
0 commit comments