From c4b633407dcd7e7b7b5c9a780edb3a8dc906eb7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johann=20Kl=C3=A4hn?= Date: Tue, 7 Jan 2014 17:53:17 +0100 Subject: [PATCH] prevent tests being shadowed by first line rule --- spec/indent/indent_spec.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index db7a49c..9fa034d 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -2,7 +2,16 @@ require "spec_helper" shared_examples_for "vim" do - before(:each) { vim.normal 'gg"_dG' } # clear buffer + before(:each) { + # clear buffer + vim.normal 'gg"_dG' + + # Insert two blank lines. + # The first line is a corner case in this plugin that would shadow the + # correct behaviour of other tests. Thus we explicitly jump to the first + # line when we require so. + vim.feedkeys 'i\\\' + } describe "when using the indent plugin" do it "sets the indentexpr and indentkeys options" do @@ -17,7 +26,7 @@ shared_examples_for "vim" do end describe "when entering the first line" do - before { vim.feedkeys 'ipass' } + before { vim.feedkeys '0ggipass' } it "does not indent" do proposed_indent.should == 0 -- 2.39.2