mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
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:
@@ -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 " "
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user