From 7d64cd179ee5848c1c0b40ca74f74bc3f2b6dfc3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 30 Oct 2013 16:44:18 -0600 Subject: [PATCH] Always mock atom.packages.resolvePackagePath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …instead of only in package specs. This allows specs that assume it is mocked to work correctly when we run the full spec suite. Namely, the settings-view specs had an issue with this. --- spec/spec-helper.coffee | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 2749e9247..4ca621718 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -59,13 +59,12 @@ beforeEach -> atom.syntax.clearGrammarOverrides() atom.syntax.clearProperties() - if specPackageName - spy = spyOn(atom.packages, 'resolvePackagePath').andCallFake (packageName) -> - if packageName is specPackageName - resolvePackagePath(specPackagePath) - else - resolvePackagePath(packageName) - resolvePackagePath = _.bind(spy.originalValue, atom.packages) + spy = spyOn(atom.packages, 'resolvePackagePath').andCallFake (packageName) -> + if specPackageName and packageName is specPackageName + resolvePackagePath(specPackagePath) + else + resolvePackagePath(packageName) + resolvePackagePath = _.bind(spy.originalValue, atom.packages) # used to reset keymap after each spec bindingSetsToRestore = _.clone(keymap.bindingSets)