test some commands

This commit is contained in:
Bailey Ling 2013-08-30 20:57:34 -04:00
parent 0548aeefcb
commit 54ec1f39ca
2 changed files with 27 additions and 0 deletions

View File

@ -56,6 +56,7 @@ endfunction!
function! airline#extensions#whitespace#toggle()
if s:enabled
autocmd! airline_whitespace CursorHold,BufWritePost
augroup! airline_whitespace
let s:enabled = 0
else
call airline#extensions#whitespace#init()

26
t/commands.vim Normal file
View File

@ -0,0 +1,26 @@
call airline#init#bootstrap()
source plugin/airline.vim
describe 'commands'
it 'should toggle off and on'
execute 'AirlineToggle'
Expect exists('#airline') to_be_false
execute 'AirlineToggle'
Expect exists('#airline') to_be_true
end
it 'should toggle whitespace off and on'
execute 'AirlineToggleWhitespace'
Expect exists('#airline_whitespace') to_be_false
execute 'AirlineToggleWhitespace'
Expect exists('#airline_whitespace') to_be_true
end
it 'should display theme name with no args'
execute 'AirlineTheme simple'
Expect g:airline_theme == 'simple'
execute 'AirlineTheme dark'
Expect g:airline_theme == 'dark'
end
end