X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/9370cda99be0cfe529c40e5c6ce48ef01940a266..b430740f94385419258e16fdf5f22dd20a5637e6:/spec/indent/indent_spec.rb diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index cd79e36..15e265a 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -199,7 +199,7 @@ shared_examples_for "vim" do end describe "when current line is dedented compared to previous line" do - before { vim.feedkeys 'i\\if x:\return True\\' } + before { vim.feedkeys 'i\\if x:\y = True\\' } it "and current line has a valid indentation (Part 1)" do vim.feedkeys '0i\if y:' proposed_indent.should == -1 @@ -216,6 +216,14 @@ shared_examples_for "vim" do end end + describe "when current line is dedented compared to the last non-empty line" do + before { vim.feedkeys 'i\\if x:\y = True\\\' } + it "and current line has a valid indentation" do + vim.feedkeys '0i\if y:' + proposed_indent.should == -1 + end + end + describe "when an 'if' is followed by" do before { vim.feedkeys 'i\\if x:\' } it "an elif, it lines up with the 'if'" do