diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 3fcbf8263..6181e9f7c 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -39,7 +39,9 @@ specPackageName = null specPackagePath = null specProjectPath = null -if specDirectory = atom.getLoadSettings().specDirectory +{specDirectory, resourcePath} = atom.getLoadSettings() + +if specDirectory specPackagePath = path.resolve(specDirectory, '..') try specPackageName = fs.readObjectSync(path.join(specPackagePath, 'package.json'))?.name @@ -68,9 +70,7 @@ beforeEach -> spyOn(atom.menu, 'sendToBrowserProcess') # reset config before each spec; don't load or save from/to `config.json` - config = new Config - resourcePath: window.resourcePath - configDirPath: atom.getConfigDirPath() + config = new Config({resourcePath, configDirPath: atom.getConfigDirPath()}) spyOn(config, 'load') spyOn(config, 'save') config.setDefaults('core', RootView.configDefaults) diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index 82dc95070..6beade358 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -23,9 +23,10 @@ setSpecDirectory = (specDirectory) -> setSpecField('specDirectory', specDirectory) runAllSpecs = -> + {resourcePath} = atom.getLoadSettings() # Only run core specs when resource path is the Atom repository - if Git.exists(window.resourcePath) - requireSpecs(path.join(window.resourcePath, 'spec')) + if Git.exists(resourcePath) + requireSpecs(path.join(resourcePath, 'spec')) setSpecType('core') fixturesPackagesPath = path.join(__dirname, 'fixtures', 'packages') @@ -34,7 +35,7 @@ runAllSpecs = -> packagePaths = _.groupBy packagePaths, (packagePath) -> if packagePath.indexOf("#{fixturesPackagesPath}#{path.sep}") is 0 'fixtures' - else if packagePath.indexOf("#{window.resourcePath}#{path.sep}") is 0 + else if packagePath.indexOf("#{resourcePath}#{path.sep}") is 0 'bundled' else 'user' diff --git a/src/window.coffee b/src/window.coffee index 014f745fa..e8f50d644 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -11,7 +11,6 @@ windowEventHandler = null # This method is called in any window needing a general environment, including specs window.setUpEnvironment = (windowMode) -> atom.windowMode = windowMode - window.resourcePath = atom.getLoadSettings().resourcePath atom.initialize() # Set up the default event handlers and menus for a non-editor windows.