Skip to content

Commit

Permalink
tests: remove EnsureLoaded
Browse files Browse the repository at this point in the history
This should not be necessary in general, and causes e.g. :FZF to be
loaded from the global Vim runtime (causing an assertion failure in the
tests).

It is replaced by a verbatim / trimmed down `:runtime` for the "Check
installed plugins" test.
  • Loading branch information
blueyed committed Jan 15, 2018
1 parent 1878be3 commit 431e579
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
7 changes: 0 additions & 7 deletions test/test.vader
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ Execute (Initialize test environment):
endfunction
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)

function! EnsureLoaded()
if has('vim_starting')
runtime! plugin/**/*.vim
endif
endfunction

function! RmRf(file)
call system(printf('rm -rf "%s"', a:file))
endfunction
Expand Down Expand Up @@ -98,7 +92,6 @@ Execute (Cleanup):
silent! delf PlugStatusSorted
silent! delf AssertExpect
silent! delf PlugUpdated
silent! delf EnsureLoaded
silent! delf ReloadPlug
silent! delc AssertExpect
silent! unmap /
Expand Down
5 changes: 1 addition & 4 deletions test/workflow.vader
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ Given (Unaligned code):
aa=2

Execute (Check installed plugins):
call EnsureLoaded()
runtime plugin/fnr.vim plugin/redis.vim
Assert exists(':FNR'), 'FNR command should be found'
Assert !exists(':RedisExecute'), 'RedisExecute command still should not be found'

Expand Down Expand Up @@ -1341,7 +1341,6 @@ Execute (Strict load order):
Plug '$PLUG_FIXTURES/xxx'
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
call plug#end()
call EnsureLoaded()
setf xxx
Log 'Case 1: ' . &rtp
AssertEqual ['yyy/ftdetect', 'yyy/after/ftdetect', 'xxx/ftdetect', 'xxx/after/ftdetect'], g:total_order[0:3]
Expand All @@ -1355,7 +1354,6 @@ Execute (Strict load order):
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
Plug '$PLUG_FIXTURES/yyy'
call plug#end()
call EnsureLoaded()
set rtp^=manually-prepended
set rtp+=manually-appended
setf xxx
Expand All @@ -1375,7 +1373,6 @@ Execute (Strict load order):
Plug '$PLUG_FIXTURES/xxx', { 'for': ['xxx'] }
Plug '$PLUG_FIXTURES/yyy', { 'for': ['xxx'] }
call plug#end()
call EnsureLoaded()
setf xxx
Log 'Case 3: ' . &rtp
AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'yyy/ftdetect', 'yyy/after/ftdetect'], g:total_order[0:3]
Expand Down

0 comments on commit 431e579

Please sign in to comment.