Set editor.autoIndent to false for tests

Auto-indenting makes it more difficult to write simple tests. So we turn it off.
This commit is contained in:
Corey Johnson
2013-01-10 09:41:33 -08:00
parent 4f0e2c1e9b
commit d2521ca8b8
2 changed files with 5 additions and 2 deletions

View File

@@ -1918,7 +1918,8 @@ describe "EditSession", ->
describe "auto-indent", ->
describe "editor.autoIndent", ->
it "auto-indents newlines by default", ->
it "auto-indents newlines if editor.autoIndent is undefined (the default)", ->
config.set("editor.autoIndent", undefined)
editSession.setCursorBufferPosition([1, 30])
editSession.insertText("\n")
expect(editSession.lineForBufferRow(2)).toBe " "
@@ -1929,7 +1930,8 @@ describe "EditSession", ->
editSession.insertText("\n")
expect(editSession.lineForBufferRow(2)).toBe ""
it "auto-indents calls to `indent` by default", ->
it "auto-indents calls to `indent` if editor.autoIndent is undefined (the default)", ->
config.set("editor.autoIndent", undefined)
editSession.setCursorBufferPosition([1, 30])
editSession.insertText("\n ")
expect(editSession.lineForBufferRow(2)).toBe " "

View File

@@ -34,6 +34,7 @@ beforeEach ->
spyOn(config, 'load')
spyOn(config, 'save')
config.set "editor.fontSize", 16
config.set "editor.autoIndent", false
# make editor display updates synchronous
spyOn(Editor.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay()