Move loadPackages to atom global. Handle '-tmbundle' in regex.

This simplifies the loading of TextMate bundles in the spec and benchmark helpers. Since `loadBundle` was already implemented on `atom`, it made sense to move this logic here. Config is now more focused on its core job of handling configuration, not loading bundles.
This commit is contained in:
Nathan Sobo
2012-12-20 21:32:33 -07:00
parent dd8597cc9c
commit c7605b8aa6
4 changed files with 29 additions and 37 deletions

View File

@@ -19,20 +19,17 @@ requireStylesheet "jasmine.css"
require.paths.unshift(require.resolve('fixtures/packages'))
# Temporary solution to load textmate bundles for specs
window.config = new Config()
config.assignDefaults()
config.loadPackages(config.getAvailableTextMateBundles())
# Load TextMate bundles, which specs rely on (but not other packages)
atom.loadPackages(atom.getAvailableTextMateBundles())
beforeEach ->
window.fixturesProject = new Project(require.resolve('fixtures'))
window.resetTimeouts()
# don't load or save user configuration
# reset config after each spec; don't load or save from/to `config.json`
window.config = new Config()
spyOn(config, 'load')
spyOn(config, 'save')
config.assignDefaults()
config.set "editor.fontSize", 16
# make editor display updates synchronous