Compare commits

...

9 Commits

Author SHA1 Message Date
Adam Stankiewicz
752a647be1 fix: Use bash for build script 2013-09-14 20:48:46 +02:00
Adam Stankiewicz
97a0bdcef6 fix: Build spec, use bash, check return status 2013-09-14 20:46:47 +02:00
Adam Stankiewicz
58f119c57f Fix url in the README
[skip ci]
2013-09-14 20:43:34 +02:00
Adam Stankiewicz
0ac0389039 Add simple spec for build script 2013-09-14 20:42:27 +02:00
Adam Stankiewicz
4bf3f6c300 Add travis badge and additional info in features 2013-09-14 20:30:57 +02:00
Adam Stankiewicz
4a80e945ad Add Travis CI integration 2013-09-14 20:23:24 +02:00
Adam Stankiewicz
27f22774b1 Move specs location one level down 2013-09-14 20:20:59 +02:00
Adam Stankiewicz
f6be1d3d13 Reorganize build script a little 2013-09-14 20:10:55 +02:00
Adam Stankiewicz
77f091c8c7 Add specs to be sure all plugins are loading properly 2013-09-14 20:09:32 +02:00
8 changed files with 86 additions and 6 deletions

8
.travis.yml Normal file
View File

@@ -0,0 +1,8 @@
language: ruby
rvm:
- 1.9.3
before_install: sudo apt-get install vim-gtk
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script: bundle exec rspec

4
Gemfile Normal file
View File

@@ -0,0 +1,4 @@
source 'https://rubygems.org'
gem 'vimrunner'
gem 'rspec'

20
Gemfile.lock Normal file
View File

@@ -0,0 +1,20 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.1.3)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.0)
vimrunner (0.3.0)
PLATFORMS
ruby
DEPENDENCIES
rspec
vimrunner

View File

@@ -1,4 +1,7 @@
# vim-polyglot
# vim-polyglot [![Build Status][travis-img-url]][travis-url]
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.png
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
A collection of language packs for Vim.
@@ -9,6 +12,7 @@ One to rule them all, one to find them, one to bring them all and in the darknes
- It clones even faster as all unnecessary files are ignored (like enormous documentation from php support).
- Best syntax and indentation support. If someone releases better language pack, it will be replaced here.
- No support for esoteric languages (vim-polyglot supports modern ones like `slim` though).
- Each build is tested by automated Travis CI setup using vimrunner gem. Spee `spec` directory.
## Installation

10
build
View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -E
@@ -50,10 +50,6 @@ copy_dir() {
done
}
rm -rf tmp
rm -rf $DIRS
mkdir -p tmp
PACKS="
arduino:sudar/vim-arduino-syntax
bundler:tpope/vim-bundler
@@ -100,6 +96,10 @@ PACKS="
xls:vim-scripts/XSLT-syntax
"
rm -rf tmp
rm -rf $DIRS
mkdir -p tmp
printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"

8
spec/build_spec.rb Normal file
View File

@@ -0,0 +1,8 @@
$plugin_path = File.expand_path('../..', __FILE__)
describe 'build script' do
it 'should run and return success code' do
Dir.chdir($plugin_path)
expect(system('bash ./build')).to be_true
end
end

14
spec/loading_spec.rb Normal file
View File

@@ -0,0 +1,14 @@
require 'spec_helper'
describe "My Vim plugin" do
languages = Dir["#{$plugin_path}/syntax/*.vim"].map { |f| f.split('/').last.gsub('.vim', '') }
languages.each do |lang|
it "should parse .#{lang} file" do
write_file "test.#{lang}", ""
vim.edit "test.#{lang}"
vim.insert "sample"
vim.write
end
end
end

22
spec/spec_helper.rb Executable file
View File

@@ -0,0 +1,22 @@
require 'vimrunner'
require 'vimrunner/rspec'
$plugin_path = File.expand_path('../..', __FILE__)
Vimrunner::RSpec.configure do |config|
# Use a single Vim instance for the test suite. Set to false to use an
# instance per test (slower, but can be easier to manage).
config.reuse_server = true
# Decide how to start a Vim instance. In this block, an instance should be
# spawned and set up with anything project-specific.
config.start_vim do
vim = Vimrunner.start
# Setup your plugin in the Vim instance
vim.add_plugin($plugin_path)
# The returned value is the Client available in the tests.
vim
end
end