Merge pull request #1826 from atom/cj-workspace-spec

Add atom.workspace to all specs
This commit is contained in:
Corey Johnson
2014-04-02 16:14:06 -07:00
2 changed files with 4 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
KeymapManager = require '../src/keymap-extensions'
{$, WorkspaceView} = require 'atom'
{$, WorkspaceView, Workspace} = require 'atom'
Config = require '../src/config'
{Point} = require 'text-buffer'
Project = require '../src/project'
@@ -50,6 +50,7 @@ beforeEach ->
$.fx.off = true
projectPath = specProjectPath ? path.join(@specDirectory, 'fixtures')
atom.project = new Project(path: projectPath)
atom.workspace = new Workspace()
atom.keymaps.keyBindings = _.clone(keyBindingsToRestore)
window.resetTimeouts()
@@ -112,7 +113,7 @@ afterEach ->
atom.workspaceView = null
delete atom.state.workspace
atom.project?.destroy?()
atom.project?.destroy()
atom.project = null
delete atom.state.packageStates

View File

@@ -78,7 +78,7 @@ class WorkspaceView extends View
@div class: 'panes', outlet: 'panes'
initialize: (@model) ->
@model ?= new Workspace
@model = atom.workspace ? new Workspace unless @model?
panes = new PaneContainerView(@model.paneContainer)
@panes.replaceWith(panes)