Load user configuration as part of RootView initialization, before any editors are created

This commit is contained in:
Nathan Sobo
2012-06-20 16:06:45 -06:00
parent c97d78a31d
commit b4d77fd107
4 changed files with 27 additions and 20 deletions

View File

@@ -3,7 +3,6 @@ fs = require 'fs'
describe "Window", ->
beforeEach ->
spyOn(window, 'loadUserConfiguration')
window.startup()
afterEach ->

View File

@@ -4,6 +4,7 @@ _ = require 'underscore'
Keymap = require 'keymap'
Point = require 'point'
Directory = require 'directory'
RootView = require 'root-view'
require 'window'
window.showConsole()
@@ -17,6 +18,7 @@ beforeEach ->
directoriesWithSubscriptions = []
afterEach ->
delete window.rootView if window.rootView
$('#jasmine-content').empty()
document.title = defaultTitle
ensureNoDirectorySubscriptions()
@@ -24,6 +26,9 @@ afterEach ->
window.keymap.bindKeys '*', 'meta-w': 'close'
$(document).on 'close', -> window.close()
# Don't load user configuration in specs, because it's variable
RootView.prototype.loadUserConfiguration = ->
Directory.prototype.originalOn = Directory.prototype.on
Directory.prototype.on = (args...) ->
directoriesWithSubscriptions.push(this) if @subscriptionCount() == 0