Always mock atom.packages.resolvePackagePath

…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.
This commit is contained in:
Nathan Sobo
2013-10-30 16:44:18 -06:00
parent 56ff3b79e4
commit 7d64cd179e

View File

@@ -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)