From 0a6b833e7c5c00aa652a54b76dbb0da742855b4e Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 15 Sep 2013 22:52:42 -0400 Subject: [PATCH] tests for configuring accents directly. --- autoload/airline/parts.vim | 4 ++++ t/parts.vim | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index f1b7c00..e5cbd38 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -30,6 +30,10 @@ function! airline#parts#define_condition(key, predicate) call airline#parts#define(a:key, { 'condition': a:predicate }) endfunction +function! airline#parts#define_accent(key, accent) + call airline#parts#define(a:key, { 'accent': a:accent }) +endfunction + function! airline#parts#define_empty(keys) for key in a:keys call airline#parts#define_raw(key, '') diff --git a/t/parts.vim b/t/parts.vim index ba4341d..ee7c92e 100644 --- a/t/parts.vim +++ b/t/parts.vim @@ -30,5 +30,10 @@ describe 'parts' call airline#parts#define_condition('part', '1') Expect airline#parts#get('part').condition == '1' end + + it 'can define a accent' + call airline#parts#define_accent('part', 'red') + Expect airline#parts#get('part').accent == 'red' + end end