Load the config from Atom class so as not to duplicate

This commit is contained in:
Ben Ogle 2014-09-24 14:53:24 -07:00
parent 5bf09716ef
commit 5fdf3f894c
3 changed files with 4 additions and 7 deletions

View File

@ -49,8 +49,5 @@ describe "the `atom` global", ->
expect(version).toBe 'version'
describe "loading default config", ->
beforeEach ->
atom.loadConfig()
it 'loads the default core config', ->
expect(atom.config.get('core.excludeVcsIgnoredPaths')).toBe true

View File

@ -91,16 +91,16 @@ beforeEach ->
config = new Config({resourcePath, configDirPath: atom.getConfigDirPath()})
spyOn(config, 'load')
spyOn(config, 'save')
config.setDefaults('core', WorkspaceView.configDefaults)
config.setDefaults('editor', TextEditorView.configDefaults)
atom.config = config
atom.loadConfig()
config.set "core.destroyEmptyPanes", false
config.set "editor.fontFamily", "Courier"
config.set "editor.fontSize", 16
config.set "editor.autoIndent", false
config.set "core.disabledPackages", ["package-that-throws-an-exception",
"package-with-broken-package-json", "package-with-broken-keymap"]
config.load.reset()
config.save.reset()
atom.config = config
# make editor display updates synchronous
spyOn(TextEditorView.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay()

View File

@ -603,9 +603,9 @@ class Atom extends Model
@deserializeWorkspaceView()
loadConfig: ->
@config.load()
@config.setSchema('core', {type: 'object', properties: require('./workspace-view').config})
@config.setDefaults('editor', require('./editor-view').configDefaults)
@config.load()
loadThemes: ->
@themes.load()