From eae06b62bc2ee54a22e1483a074aa8d2f48e394c Mon Sep 17 00:00:00 2001 From: probablycorey Date: Mon, 13 May 2013 12:18:24 -0700 Subject: [PATCH] Spec :lipstick: --- spec/app/edit-session-spec.coffee | 36 ++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/spec/app/edit-session-spec.coffee b/spec/app/edit-session-spec.coffee index 956d327db..08c1e0c59 100644 --- a/spec/app/edit-session-spec.coffee +++ b/spec/app/edit-session-spec.coffee @@ -2203,29 +2203,31 @@ describe "EditSession", -> editSession.cutSelectedText() describe "editor.autoIndent", -> - describe "when `indent` is called", -> - it "auto-indents line if editor.autoIndent is true", -> - editSession.setCursorBufferPosition([1, 30]) - editSession.insertText("\n ") - expect(editSession.lineForBufferRow(2)).toBe " " + describe "when editor.autoIndent is false (default)", -> + describe "when `indent` is triggered", -> + it "does not auto-indent the line", -> + editSession.setCursorBufferPosition([1, 30]) + editSession.insertText("\n ") + expect(editSession.lineForBufferRow(2)).toBe " " - config.set("editor.autoIndent", true) - editSession.indent() - expect(editSession.lineForBufferRow(2)).toBe " " - - it "does not auto-indent line if editor.autoIndent is false", -> - editSession.setCursorBufferPosition([1, 30]) - editSession.insertText("\n ") - expect(editSession.lineForBufferRow(2)).toBe " " - - config.set("editor.autoIndent", false) - editSession.indent() - expect(editSession.lineForBufferRow(2)).toBe " " + config.set("editor.autoIndent", false) + editSession.indent() + expect(editSession.lineForBufferRow(2)).toBe " " describe "when editor.autoIndent is true", -> beforeEach -> config.set("editor.autoIndent", true) + describe "when `indent` is triggered", -> + it "auto-indents the line", -> + editSession.setCursorBufferPosition([1, 30]) + editSession.insertText("\n ") + expect(editSession.lineForBufferRow(2)).toBe " " + + config.set("editor.autoIndent", true) + editSession.indent() + expect(editSession.lineForBufferRow(2)).toBe " " + describe "when a newline is added", -> describe "when the line preceding the newline adds a new level of indentation", -> it "indents the newline to one additional level of indentation beyond the preceding line", ->