Skip to content

Commit

Permalink
Fix Travis CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed May 28, 2015
1 parent f85d4d7 commit 240dc9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/regressions.vader
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ Execute (#130 Proper cleanup of on-demand loading triggers):

**********************************************************************
Execute (#131 Syntax error):
call plug#begin('/no-permission')
call plug#begin('/proc/no-permission')
Plug 'junegunn/vim-emoji'
call plug#end()

redir => out
silent PlugInstall
redir END
Assert out =~ 'Invalid plug directory: /no-permission'
Assert out =~ 'Invalid plug directory: /proc/no-permission', out

**********************************************************************
Execute (#139-1 Using new remote branch):
Expand Down
23 changes: 10 additions & 13 deletions test/test.vader
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Execute (Initialize test environment):
let $PLUG_SRC = globpath(&rtp, 'autoload/plug.vim')
endif

" Temporarily patch plug.vim
call system('cp $PLUG_SRC $PLUG_SRC.org')
call writefile(extend(readfile($PLUG_SRC),
\ ['function! ResetPlug()', 'let s:loaded = {}', 'endfunction']), $PLUG_SRC)

set t_Co=256
colo default
pclose
Expand Down Expand Up @@ -40,22 +45,13 @@ Execute (Initialize test environment):
call system(printf('rm -rf "%s"', a:file))
endfunction

" Reload vim-plug to reset s:-variables
function! ReloadPlug()
let tmpdir = tempname()
let tmp = tmpdir.'/plug.vim'
call mkdir(tmpdir, 'p')
try
call writefile(readfile($PLUG_SRC), tmp)
unlet! g:loaded_plug
execute 'source' tmp
let &rtp = g:base_rtp
finally
call RmRf(tmpdir)
endtry
call ResetPlug()
source $PLUG_SRC
let &rtp = g:base_rtp
endfunction

call ReloadPlug()
source $PLUG_SRC

Execute (Print Interpreter Version):
redir => out
Expand Down Expand Up @@ -84,6 +80,7 @@ Execute (Cleanup):
silent! delc AssertExpect
silent! unmap /
silent! unmap ?
call system('mv $PLUG_SRC.org $PLUG_SRC')

Restore

0 comments on commit 240dc9c

Please sign in to comment.