]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

prevent tests being shadowed by first line rule
authorJohann Klähn <kljohann@gmail.com>
Tue, 7 Jan 2014 16:53:17 +0000 (17:53 +0100)
committerJohann Klähn <kljohann@gmail.com>
Tue, 7 Jan 2014 18:09:36 +0000 (19:09 +0100)
spec/indent/indent_spec.rb

index db7a49cea2a57fd3e20aa5555c634cf03d49bc2f..9fa034dc7879eb6f712deec2da9382a5f1527c4c 100644 (file)
@@ -2,7 +2,16 @@ require "spec_helper"
 
 shared_examples_for "vim" do
 
 
 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\<CR>\<CR>\<ESC>'
+  }
 
   describe "when using the indent plugin" do
     it "sets the indentexpr and indentkeys options" do
 
   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
   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
 
     it "does not indent" do
       proposed_indent.should == 0