Add specs to be sure all plugins are loading properly
This commit is contained in:
parent
17149b4657
commit
77f091c8c7
4
spec/Gemfile
Normal file
4
spec/Gemfile
Normal file
@ -0,0 +1,4 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'vimrunner'
|
||||
gem 'rspec'
|
20
spec/Gemfile.lock
Normal file
20
spec/Gemfile.lock
Normal 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
|
14
spec/spec/loading_spec.rb
Normal file
14
spec/spec/loading_spec.rb
Normal 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
|
23
spec/spec/spec_helper.rb
Executable file
23
spec/spec/spec_helper.rb
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user