From: Johann Klähn Date: Fri, 8 Nov 2013 19:52:17 +0000 (+0100) Subject: run test cases for different settings X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/502aea33111e33371315b4b5e93f4ba3452dbf80?ds=sidebyside run test cases for different settings --- diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index 38ce192..bd0d0d9 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 @@ -86,7 +86,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 @@ -131,3 +131,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