Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 8108c76

Browse files
Wliudarangi
authored andcommitted
Fix specs
1 parent 49ed2cd commit 8108c76

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

spec/tree-view-package-spec.coffee

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,11 +2353,13 @@ describe "TreeView", ->
23532353
expect(callback).not.toHaveBeenCalled()
23542354

23552355
describe "tree-view:move", ->
2356+
beforeEach ->
2357+
jasmine.attachToDOM(workspaceElement)
2358+
23562359
describe "when a file is selected", ->
23572360
[moveDialog, callback] = []
23582361

23592362
beforeEach ->
2360-
jasmine.attachToDOM(workspaceElement)
23612363
callback = jasmine.createSpy("onEntryMoved")
23622364
treeView.onEntryMoved(callback)
23632365

@@ -2518,8 +2520,6 @@ describe "TreeView", ->
25182520
moveDialog = null
25192521

25202522
beforeEach ->
2521-
jasmine.attachToDOM(workspaceElement)
2522-
25232523
waitForWorkspaceOpenEvent ->
25242524
atom.workspace.open(filePath)
25252525

@@ -3848,7 +3848,26 @@ describe "TreeView", ->
38483848

38493849
describe "showSelectedEntryInFileManager()", ->
38503850
beforeEach ->
3851-
spyOn(shell, 'showItemInFolder').andReturn(false)
3851+
atom.notifications.clear()
3852+
jasmine.attachToDOM(workspaceElement)
3853+
3854+
it "displays the standard error output when the process fails", ->
3855+
{BufferedProcess} = require 'atom'
3856+
spyOn(BufferedProcess.prototype, 'spawn').andCallFake ->
3857+
EventEmitter = require 'events'
3858+
fakeProcess = new EventEmitter()
3859+
fakeProcess.send = ->
3860+
fakeProcess.kill = ->
3861+
fakeProcess.stdout = new EventEmitter()
3862+
fakeProcess.stdout.setEncoding = ->
3863+
fakeProcess.stderr = new EventEmitter()
3864+
fakeProcess.stderr.setEncoding = ->
3865+
@process = fakeProcess
3866+
process.nextTick ->
3867+
fakeProcess.stderr.emit('data', 'bad process')
3868+
fakeProcess.stderr.emit('close')
3869+
fakeProcess.stdout.emit('close')
3870+
fakeProcess.emit('exit')
38523871

38533872
it "does nothing if no entry is selected", ->
38543873
treeView.deselect()

0 commit comments

Comments
 (0)