From 0ac0389039fa782316fd791b4bf174dd02b9725f Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 14 Sep 2013 20:42:27 +0200 Subject: [PATCH] Add simple spec for build script --- spec/build_spec.rb | 8 ++++++++ spec/loading_spec.rb | 2 +- spec/spec_helper.rb | 5 ++--- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 spec/build_spec.rb diff --git a/spec/build_spec.rb b/spec/build_spec.rb new file mode 100644 index 0000000..8e0d6ed --- /dev/null +++ b/spec/build_spec.rb @@ -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) + system('./build') + end +end diff --git a/spec/loading_spec.rb b/spec/loading_spec.rb index 459f072..99d7fe2 100644 --- a/spec/loading_spec.rb +++ b/spec/loading_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe "My Vim plugin" do - languages = Dir["#{PLUGIN_PATH}/syntax/*.vim"].map { |f| f.split('/').last.gsub('.vim', '') } + languages = Dir["#{$plugin_path}/syntax/*.vim"].map { |f| f.split('/').last.gsub('.vim', '') } languages.each do |lang| it "should parse .#{lang} file" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b2cd9a2..0048686 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,7 @@ require 'vimrunner' require 'vimrunner/rspec' -PLUGIN_PATH = File.expand_path('../..', __FILE__) -puts PLUGIN_PATH +$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 @@ -15,7 +14,7 @@ Vimrunner::RSpec.configure do |config| vim = Vimrunner.start # Setup your plugin in the Vim instance - vim.add_plugin(PLUGIN_PATH) + vim.add_plugin($plugin_path) # The returned value is the Client available in the tests. vim