Spy on atom.confirm instead of $native.alert in specs

This commit is contained in:
Nathan Sobo
2012-08-29 20:50:47 -05:00
parent d8ea46ee5b
commit 558ffd9cbe
2 changed files with 8 additions and 8 deletions

View File

@@ -120,7 +120,7 @@ describe "Editor", ->
fileChangeHandler = jasmine.createSpy('fileChange')
editSession.buffer.file.on 'contents-change', fileChangeHandler
spyOn($native, "alert")
spyOn(atom, "confirm")
fs.write(path, "a file change")
@@ -128,7 +128,7 @@ describe "Editor", ->
fileChangeHandler.callCount > 0
runs ->
expect($native.alert).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
describe ".remove()", ->
it "removes subscriptions from all edit session buffers", ->
@@ -171,11 +171,11 @@ describe "Editor", ->
describe "when buffer is modified", ->
it "triggers an alert and does not close the session", ->
spyOn(editor, 'remove').andCallThrough()
spyOn($native, 'alert')
spyOn(atom, 'confirm')
editor.insertText("I AM CHANGED!")
editor.trigger "close"
expect(editor.remove).not.toHaveBeenCalled()
expect($native.alert).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
describe ".edit(editSession)", ->
otherEditSession = null
@@ -257,7 +257,7 @@ describe "Editor", ->
bufferContentsChangeHandler = jasmine.createSpy('fileChange')
editSession.on 'buffer-contents-change-on-disk', bufferContentsChangeHandler
spyOn($native, "alert")
spyOn(atom, "confirm")
fs.write(path, "a file change")
@@ -265,7 +265,7 @@ describe "Editor", ->
bufferContentsChangeHandler.callCount > 0
runs ->
expect($native.alert).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
describe ".loadNextEditSession()", ->
it "loads the next editor state and wraps to beginning when end is reached", ->

View File

@@ -709,9 +709,9 @@ describe "TreeView", ->
describe "tree-view:remove", ->
it "shows the native alert dialog", ->
fileView.click()
spyOn(Native, 'alert')
spyOn(atom, 'confirm')
treeView.trigger 'tree-view:remove'
expect(Native.alert).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
describe "file system events", ->
temporaryFilePath = null