From: Johann Klähn Date: Tue, 7 Jan 2014 16:53:17 +0000 (+0100) Subject: prevent tests being shadowed by first line rule X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/c4b633407dcd7e7b7b5c9a780edb3a8dc906eb7c?hp=-c prevent tests being shadowed by first line rule --- c4b633407dcd7e7b7b5c9a780edb3a8dc906eb7c 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