From 502aea33111e33371315b4b5e93f4ba3452dbf80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johann=20Kl=C3=A4hn?= Date: Fri, 8 Nov 2013 20:52:17 +0100 Subject: [PATCH 1/1] run test cases for different settings --- spec/indent/indent_spec.rb | 19 +++++++++++++++++-- spec/spec_helper.rb | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) 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 -- 2.39.5