test the layout config for the default extension.
This commit is contained in:
parent
e852fb388f
commit
d268744077
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
doc/tags
|
||||
*.lock
|
||||
.vim-flavor
|
||||
|
@ -27,7 +27,9 @@ function! airline#extensions#branch#get_head()
|
||||
endif
|
||||
endif
|
||||
|
||||
return empty(head) ? s:empty_message : s:symbol.' '.head
|
||||
return empty(head)
|
||||
\ ? s:empty_message
|
||||
\ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.' ', head)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
|
22
t/extensions_default.vim
Normal file
22
t/extensions_default.vim
Normal file
@ -0,0 +1,22 @@
|
||||
call airline#init#bootstrap()
|
||||
|
||||
describe 'default'
|
||||
before
|
||||
let s:builder = airline#builder#new({'active': 1})
|
||||
end
|
||||
|
||||
it 'should use the layout'
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'airline_c_to_airline_a'
|
||||
Expect stl =~ 'airline_a_to_airline_b'
|
||||
Expect stl =~ 'airline_b_to_airline_warning'
|
||||
Expect stl =~ 'airline_x_to_airline_z'
|
||||
Expect stl =~ 'airline_z_to_airline_y'
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user