Specs don't prompt to save editors by default.

This commit is contained in:
probablycorey
2013-12-12 10:35:11 -08:00
parent 787b6fb677
commit f414c0955b
3 changed files with 4 additions and 0 deletions

View File

@@ -2614,6 +2614,7 @@ describe "Editor", ->
describe ".shouldPromptToSave()", ->
it "returns false when an edit session's buffer is in use by more than one session", ->
jasmine.unspy(editor, 'shouldPromptToSave')
expect(editor.shouldPromptToSave()).toBeFalsy()
buffer.setText('changed')
expect(editor.shouldPromptToSave()).toBeTruthy()

View File

@@ -147,6 +147,7 @@ describe "Pane", ->
describe "if the item is modified", ->
beforeEach ->
jasmine.unspy(editor2, 'shouldPromptToSave')
spyOn(editor2, 'save')
spyOn(editor2, 'saveAs')

View File

@@ -9,6 +9,7 @@ Keymap = require '../src/keymap'
Config = require '../src/config'
{Point} = require 'telepath'
Project = require '../src/project'
Editor = require '../src/editor'
EditorView = require '../src/editor-view'
TokenizedBuffer = require '../src/tokenized-buffer'
pathwatcher = require 'pathwatcher'
@@ -92,6 +93,7 @@ beforeEach ->
spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout
spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout
spyOn(File.prototype, "detectResurrectionAfterDelay").andCallFake -> @detectResurrection()
spyOn(Editor.prototype, "shouldPromptToSave").andReturn false
# make tokenization synchronous
TokenizedBuffer.prototype.chunkSize = Infinity