2015-02-28 11:45:12 +08:00
|
|
|
let g:airline#extensions#default#layout = [
|
|
|
|
\ [ 'c', 'a', 'b', 'warning' ],
|
|
|
|
\ [ 'x', 'z', 'y' ]
|
|
|
|
\ ]
|
|
|
|
|
2013-09-01 22:38:00 +08:00
|
|
|
source plugin/airline.vim
|
2015-02-28 11:45:12 +08:00
|
|
|
doautocmd VimEnter
|
2013-08-31 10:44:20 +08:00
|
|
|
|
|
|
|
describe 'default'
|
|
|
|
before
|
|
|
|
let s:builder = airline#builder#new({'active': 1})
|
|
|
|
end
|
|
|
|
|
2021-10-27 00:09:53 +08:00
|
|
|
it 'should use the layout "airline_a_to_airline_b"'
|
2013-08-31 10:44:20 +08:00
|
|
|
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
|
|
|
let stl = s:builder.build()
|
|
|
|
Expect stl =~ 'airline_c_to_airline_a'
|
2021-10-27 00:09:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should use the layout "airline_a_to_airline_b"'
|
|
|
|
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
|
|
|
let stl = s:builder.build()
|
2013-08-31 10:44:20 +08:00
|
|
|
Expect stl =~ 'airline_a_to_airline_b'
|
2021-10-27 00:09:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should use the layout "airline_b_to_airline_warning"'
|
|
|
|
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
|
|
|
let stl = s:builder.build()
|
2013-08-31 10:44:20 +08:00
|
|
|
Expect stl =~ 'airline_b_to_airline_warning'
|
2021-10-27 00:09:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should use the layout "airline_x_to_airline_z"'
|
|
|
|
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
|
|
|
let stl = s:builder.build()
|
2013-08-31 10:44:20 +08:00
|
|
|
Expect stl =~ 'airline_x_to_airline_z'
|
2021-10-27 00:09:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should use the layout "airline_z_to_airline_y"'
|
|
|
|
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
|
|
|
let stl = s:builder.build()
|
2013-08-31 10:44:20 +08:00
|
|
|
Expect stl =~ 'airline_z_to_airline_y'
|
|
|
|
end
|
2013-09-01 22:38:00 +08:00
|
|
|
|
|
|
|
it 'should only render warning section in active splits'
|
|
|
|
wincmd s
|
2013-09-05 22:01:57 +08:00
|
|
|
Expect airline#statusline(1) =~ 'warning'
|
|
|
|
Expect airline#statusline(2) !~ 'warning'
|
2013-09-01 22:38:00 +08:00
|
|
|
wincmd c
|
|
|
|
end
|
2013-08-31 10:44:20 +08:00
|
|
|
end
|