summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-09-14 20:09:32 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2013-09-14 20:09:32 +0200
commit77f091c8c7ab6dbd1d1edc778a8da7ff62731f6b (patch)
tree0e92427e735401c58da49be802124f819e71eaae
parent17149b465797e74f6ec5e817c14583401215546e (diff)
downloadvim-polyglot-77f091c8c7ab6dbd1d1edc778a8da7ff62731f6b.tar.gz
vim-polyglot-77f091c8c7ab6dbd1d1edc778a8da7ff62731f6b.zip
Add specs to be sure all plugins are loading properly
-rw-r--r--spec/Gemfile4
-rw-r--r--spec/Gemfile.lock20
-rw-r--r--spec/spec/loading_spec.rb14
-rwxr-xr-xspec/spec/spec_helper.rb23
4 files changed, 61 insertions, 0 deletions
diff --git a/spec/Gemfile b/spec/Gemfile
new file mode 100644
index 00000000..4a544814
--- /dev/null
+++ b/spec/Gemfile
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+gem 'vimrunner'
+gem 'rspec'
diff --git a/spec/Gemfile.lock b/spec/Gemfile.lock
new file mode 100644
index 00000000..f88e86d1
--- /dev/null
+++ b/spec/Gemfile.lock
@@ -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
diff --git a/spec/spec/loading_spec.rb b/spec/spec/loading_spec.rb
new file mode 100644
index 00000000..459f0720
--- /dev/null
+++ b/spec/spec/loading_spec.rb
@@ -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
diff --git a/spec/spec/spec_helper.rb b/spec/spec/spec_helper.rb
new file mode 100755
index 00000000..b9205d27
--- /dev/null
+++ b/spec/spec/spec_helper.rb
@@ -0,0 +1,23 @@
+require 'vimrunner'
+require 'vimrunner/rspec'
+
+PLUGIN_PATH = File.expand_path('../../..', __FILE__)
+puts PLUGIN_PATH
+
+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