From: Hynek Schlawack Date: Sat, 9 Nov 2013 15:08:57 +0000 (-0800) Subject: Merge pull request #19 from kljohann/tests X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/b0bb7f66733400fe8ac914fab8860aec8d38b915?hp=31a2fd4cf80abba74dc3ef9fb0ceed8b540d2a1c Merge pull request #19 from kljohann/tests Run test cases for different sets of settings While we care only about 4 spaces, running it with both may uncover subtle bugs. --- diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index 21d14b7..eb3c8a6 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe "vim" do +shared_examples_for "vim" do before(:each) { vim.normal 'gg"_dG' } # clear buffer @@ -100,7 +100,7 @@ describe "vim" do end it "indents relative to line above" do - vim.feedkeys 'i\tvalue = test + \\\\\' + vim.feedkeys 'i\value = test + \\\\\' indent.should == shiftwidth * 2 end end @@ -145,3 +145,18 @@ describe "vim" do end end +describe "vim when using width of 4" do + before { + vim.command("set sw=4 ts=4 sts=4 et") + } + + it_behaves_like "vim" +end + +describe "vim when using width of 8" do + before { + vim.command("set sw=8 ts=8 sts=8 et") + } + + it_behaves_like "vim" +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3a07436..b1e82a1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,8 @@ require 'vimrunner' require 'vimrunner/rspec' Vimrunner::RSpec.configure do |config| - config.reuse_server = true + # FIXME: reuse_server = true seems to hang after a certain number of test cases + config.reuse_server = false config.start_vim do vim = Vimrunner.start