X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/68c34f9b2944a9ebf1f970d2d54b915806a121ad..784f6ccc15461a942888c3fe331f5e0dd3f0a9a0:/spec/indent/indent_spec.rb diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index db66b8f..2ff0caf 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -205,14 +205,14 @@ shared_examples_for "vim" do describe "when using a function definition" do it "indents shiftwidth spaces" do vim.feedkeys 'idef long_function_name(\arg' - indent.should == shiftwidth * 2 + indent.should == shiftwidth end end describe "when using a class definition" do it "indents shiftwidth spaces" do vim.feedkeys 'iclass Foo(\' - indent.should == shiftwidth * 2 + indent.should == shiftwidth end end @@ -430,7 +430,7 @@ shared_examples_for "vim" do it "ignores the call signature after a function" do vim.feedkeys 'idef f( JEDI_CALL_SIGNATURE\' - indent.should == shiftwidth * 2 + indent.should == shiftwidth end end end @@ -744,3 +744,18 @@ describe "o within TODO" do indent.should == shiftwidth end end + +describe "elif after else" do + before { + vim.feedkeys '\ggdG' + } + + it "is indented to the outer if" do + vim.feedkeys 'iif 1:\if 2:\pass\else:\pass\elif 3:\' + indent.should == 0 + + vim.feedkeys '\ggdG' + vim.feedkeys 'i if 1:\if 2:\pass\else:\pass\elif 3:\' + indent.should == 4 + end +end