From ce4cb0db80df1dfa43469c23d274c22c76a6dd01 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Wed, 22 May 2013 16:28:13 -0700 Subject: [PATCH] Test window.closeWithoutConfirm instead of window.close --- spec/app/window-spec.coffee | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/app/window-spec.coffee b/spec/app/window-spec.coffee index 354c9e5ef..baf2f68ad 100644 --- a/spec/app/window-spec.coffee +++ b/spec/app/window-spec.coffee @@ -38,28 +38,28 @@ describe "Window", -> describe "window:close event", -> describe "when no pane items are modified", -> - it "calls window.close", -> - spyOn window, 'close' + it "calls window.closeWithoutConfirm", -> + spyOn window, 'closeWithoutConfirm' $(window).trigger 'window:close' - expect(window.close).toHaveBeenCalled() + expect(window.closeWithoutConfirm).toHaveBeenCalled() describe "when pane items are are modified", -> - it "prompts user to save and and calls window.close", -> - spyOn(window, 'close') + it "prompts user to save and and calls window.closeWithoutConfirm", -> + spyOn(window, 'closeWithoutConfirm') spyOn(atom, "confirm").andCallFake (a, b, c, d, e, f, g, noSave) -> noSave() editSession = rootView.open("sample.js") editSession.insertText("I look different, I feel different.") $(window).trigger 'window:close' - expect(window.close).toHaveBeenCalled() + expect(window.closeWithoutConfirm).toHaveBeenCalled() expect(atom.confirm).toHaveBeenCalled() it "prompts user to save and aborts if dialog is canceled", -> - spyOn(window, 'close') + spyOn(window, 'closeWithoutConfirm') spyOn(atom, "confirm").andCallFake (a, b, c, d, e, cancel) -> cancel() editSession = rootView.open("sample.js") editSession.insertText("I look different, I feel different.") $(window).trigger 'window:close' - expect(window.close).not.toHaveBeenCalled() + expect(window.closeWithoutConfirm).not.toHaveBeenCalled() expect(atom.confirm).toHaveBeenCalled() describe "requireStylesheet(path)", ->