mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Merge pull request #1826 from atom/cj-workspace-spec
Add atom.workspace to all specs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user