aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/cacheFactorySpec.js
diff options
context:
space:
mode:
authorJeremy Tymes2012-11-13 07:33:26 -0500
committerIgor Minar2012-11-24 21:56:28 +0100
commit55d15806fb14b1d98b5ca2770bbbb59e11548c62 (patch)
tree07080d4a226fc2a380d058a0fcc67bd6197ecd9d /test/ng/cacheFactorySpec.js
parent94e1c0391c351b6f691fad8abed2828fa20548b2 (diff)
downloadangular.js-55d15806fb14b1d98b5ca2770bbbb59e11548c62.tar.bz2
fix($cacheFactory): return undefined when removing non-existent entry
Instead of throwning an exception, remove should return undefined when cache entry to be removed doesn't exist. Closes #1497
Diffstat (limited to 'test/ng/cacheFactorySpec.js')
-rw-r--r--test/ng/cacheFactorySpec.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ng/cacheFactorySpec.js b/test/ng/cacheFactorySpec.js
index dc68b63d..88e8e523 100644
--- a/test/ng/cacheFactorySpec.js
+++ b/test/ng/cacheFactorySpec.js
@@ -89,6 +89,11 @@ describe('$cacheFactory', function() {
}));
+ it('should return undefined when entry does not exist', inject(function($cacheFactory) {
+ expect(cache.remove('non-existent')).toBeUndefined();
+ }));
+
+
it('should stringify keys', inject(function($cacheFactory) {
cache.put('123', 'foo');
cache.put(123, 'bar');