From a89fdd77148afd7b79bfbaf5392dabb76b08434a Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 6 Feb 2013 15:52:16 -0800 Subject: [PATCH] Reset the loadedPackages before each test. Also stop including fixturePackagesPath in configs.packageDirPaths. Instead load fixture packages as needed --- spec/spec-helper.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 090602e9a..8331d5ce7 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -18,19 +18,20 @@ require.paths.unshift(fixturePackagesPath) [bindingSetsToRestore, bindingSetsByFirstKeystrokeToRestore] = [] # Specs rely on TextMate bundles (but not atom packages) -pack.load() for pack in atom.getTextMatePackages() +textMatePackages = atom.loadTextMatePackages() beforeEach -> window.fixturesProject = new Project(require.resolve('fixtures')) window.resetTimeouts() + atom.loadedPackages = _.clone(textMatePackages) + # used to reset keymap after each spec bindingSetsToRestore = _.clone(keymap.bindingSets) bindingSetsByFirstKeystrokeToRestore = _.clone(keymap.bindingSetsByFirstKeystroke) # reset config before each spec; don't load or save from/to `config.json` window.config = new Config() - config.packageDirPaths.unshift(fixturePackagesPath) spyOn(config, 'load') spyOn(config, 'save') config.set "editor.fontSize", 16