diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_should_do_nothing_conditions.vader | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/test_should_do_nothing_conditions.vader b/test/test_should_do_nothing_conditions.vader index 062ab875..de2e2782 100644 --- a/test/test_should_do_nothing_conditions.vader +++ b/test/test_should_do_nothing_conditions.vader @@ -4,10 +4,18 @@ Before: Save g:ale_enabled Save &l:statusline + let b:fake_mode = 'n' + call ale#test#SetDirectory('/testplugin/test') let b:funky_command_created = 0 + runtime autoload/ale/util.vim + + function! ale#util#Mode(...) abort + return b:fake_mode + endfunction + " We will test for the existence of this command, so create one if needed. if !exists(':CtrlPFunky') command CtrlPFunky echo @@ -25,6 +33,9 @@ After: endif unlet! b:funky_command_created + unlet! b:fake_mode + + runtime autoload/ale/util.vim Given foobar(An empty file): Execute(ALE shouldn't do much of anything for ctrlp-funky buffers): @@ -44,7 +55,7 @@ Execute(ALE shouldn't try to check buffers with '.' as the filename): Assert ale#ShouldDoNothing(bufnr('')) -Execute(DoNothing should return 0 when the filetype is empty): +Execute(DoNothing should return 1 when the filetype is empty): AssertEqual \ 0, \ ale#ShouldDoNothing(bufnr('')), @@ -54,6 +65,11 @@ Execute(DoNothing should return 0 when the filetype is empty): AssertEqual 1, ale#ShouldDoNothing(bufnr('')) +Execute(DoNothing should return 1 when an operator is pending): + let b:fake_mode = 'no' + + AssertEqual 1, ale#ShouldDoNothing(bufnr('')) + Execute(The DoNothing check should work if the ALE globals aren't defined): unlet! g:ale_filetype_blacklist unlet! g:ale_maximum_file_size |