From e25d83ccbc3f6fed1a502a084899eb5c1864cf04 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 2 Feb 2013 17:58:39 -0700 Subject: [PATCH] Use new `addEqualityTester` method to employ _.isEqual in specs --- spec/spec-helper.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 1a4657488..c46be84fe 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -65,15 +65,15 @@ window.keymap.bindKeys '*', 'meta-w': 'close' $(document).on 'close', -> window.close() $('html,body').css('overflow', 'auto') +jasmine.getEnv().addEqualityTester(_.isEqual) # Use underscore's definition of equality for toEqual assertions +jasmine.getEnv().defaultTimeoutInterval = 1000 + ensureNoPathSubscriptions = -> watchedPaths = $native.getWatchedPaths() $native.unwatchAllPaths() if watchedPaths.length > 0 throw new Error("Leaking subscriptions for paths: " + watchedPaths.join(", ")) -# Use underscore's definition of equality for toEqual assertions -jasmine.Env.prototype.equals_ = _.isEqual - emitObject = jasmine.StringPrettyPrinter.prototype.emitObject jasmine.StringPrettyPrinter.prototype.emitObject = (obj) -> if obj.inspect @@ -85,8 +85,6 @@ jasmine.unspy = (object, methodName) -> throw new Error("Not a spy") unless object[methodName].originalValue? object[methodName] = object[methodName].originalValue -jasmine.getEnv().defaultTimeoutInterval = 1000 - window.keyIdentifierForKey = (key) -> if key.length > 1 # named key key