much smarter handling of separators (#204).

This commit is contained in:
Bailey Ling
2013-09-01 12:07:46 -04:00
parent 723e721b32
commit 92de8ad160
5 changed files with 65 additions and 38 deletions

View File

@@ -34,7 +34,7 @@ describe 'section'
Expect s == '%#hlgroup#hello'
end
it 'should parse out a section from the vimrc'
it 'should parse out a section from the distro'
let s = airline#section#create(['whitespace'])
Expect s =~ 'airline#extensions#whitespace#check'
end
@@ -43,5 +43,16 @@ describe 'section'
let s = airline#section#create(['asdf', 'func'])
Expect s == 'asdf%{airline#util#wrap(SectionSpec(),0)}'
end
it 'should force add separators for raw and missing keys'
let s = airline#section#create_left(['asdf', 'raw'])
Expect s == 'asdf > raw'
let s = airline#section#create_left(['asdf', 'aaaa', 'raw'])
Expect s == 'asdf > aaaa > raw'
let s = airline#section#create_right(['raw', '%f'])
Expect s == 'raw < %f'
let s = airline#section#create_right(['%t', 'asdf', '%{getcwd()}'])
Expect s == '%t < asdf < %{getcwd()}'
end
end