diff --git a/.gitignore b/.gitignore index 926ccaaf..66fb17dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ doc/tags +*.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..9ed483e7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 1.9.3 +script: rake ci diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..088f22e3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'vim-flavor', '~> 1.1' diff --git a/README.md b/README.md index 161b7e60..57cf16f4 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Lean & mean statusline for vim that's light as air. * supports 7.2 as the minimum Vim version * predictable release cycle; the master branch is experimental and may break from time to time, if you prefer stability, use the most recent tag which usually is released once every 2 weeks. +[![Build Status](https://travis-ci.org/bling/vim-airline.png)](https://travis-ci.org/bling/vim-airline) + # Straightforward customization If you don't like the defaults, you can replace all sections with standard `statusline` syntax. Give your statusline that you've built over the years a face lift. diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..741cfc25 --- /dev/null +++ b/Rakefile @@ -0,0 +1,14 @@ +#!/usr/bin/env rake + +task :default => [:test] + +task :ci => [:dump, :test] + +task :dump do + sh 'vim --version' +end + +task :test do + sh 'bundle exec vim-flavor test' +end + diff --git a/t/init.vim b/t/init.vim new file mode 100644 index 00000000..8aa4e1e6 --- /dev/null +++ b/t/init.vim @@ -0,0 +1,37 @@ +for key in ['a', 'b', 'c', 'gutter', 'x', 'y', 'z', 'warning'] + unlet! g:airline_section_{key} +endfor +call airline#init#bootstrap() + +describe 'init' + it 'section a should have mode, paste, iminsert' + Expect g:airline_section_a =~ 'mode' + Expect g:airline_section_a =~ 'paste' + Expect g:airline_section_a =~ 'iminsert' + end + + it 'section b should have hunks and branch' + Expect g:airline_section_b =~ 'hunks' + Expect g:airline_section_b =~ 'branch' + end + + it 'section c should be file' + Expect g:airline_section_c == '%<%f%m' + end + + it 'section x should be filetype' + Expect g:airline_section_x =~ '&filetype' + end + + it 'section y should be fenc and ff' + Expect g:airline_section_y =~ 'ff' + Expect g:airline_section_y =~ 'fenc' + end + + it 'section z should be line numbers' + Expect g:airline_section_z =~ '%3p%%' + Expect g:airline_section_z =~ '%3l' + Expect g:airline_section_z =~ '%3c' + end +end +