2013-08-31 01:15:41 +00:00
|
|
|
call airline#init#bootstrap()
|
|
|
|
|
|
|
|
function! SectionSpec()
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
describe 'section'
|
|
|
|
before
|
|
|
|
call airline#parts#define_text('text', 'text')
|
|
|
|
call airline#parts#define_raw('raw', 'raw')
|
|
|
|
call airline#parts#define_function('func', 'SectionSpec')
|
2013-08-31 03:26:59 +00:00
|
|
|
call airline#parts#define('hi', {
|
|
|
|
\ 'raw': 'hello',
|
|
|
|
\ 'highlight': 'hlgroup',
|
|
|
|
\ })
|
2013-08-31 01:15:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should create sections with no separators'
|
|
|
|
let s = airline#section#create(['text', 'raw', 'func'])
|
2013-08-31 16:33:58 +00:00
|
|
|
Expect s == '%{airline#util#wrap("text",0)}raw%{airline#util#wrap(SectionSpec(),0)}'
|
2013-08-31 01:15:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should create left sections with separators'
|
|
|
|
let s = airline#section#create_left(['text', 'text'])
|
2013-08-31 16:33:58 +00:00
|
|
|
Expect s == '%{airline#util#wrap("text",0)}%{airline#util#append("text",0)}'
|
2013-08-31 01:15:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should create right sections with separators'
|
|
|
|
let s = airline#section#create_right(['text', 'text'])
|
2013-08-31 16:33:58 +00:00
|
|
|
Expect s == '%{airline#util#prepend("text",0)}%{airline#util#wrap("text",0)}'
|
2013-08-31 01:15:41 +00:00
|
|
|
end
|
2013-08-31 03:26:59 +00:00
|
|
|
|
|
|
|
it 'should prefix with highlight group if provided'
|
|
|
|
let s = airline#section#create(['hi'])
|
|
|
|
Expect s == '%#hlgroup#hello'
|
|
|
|
end
|
2013-08-31 01:15:41 +00:00
|
|
|
end
|
|
|
|
|