diff options
| author | Jeremy Tymes | 2012-11-13 07:33:26 -0500 |
|---|---|---|
| committer | Igor Minar | 2012-11-24 21:58:17 +0100 |
| commit | 1eb9e22d450aa0b5c2221313e8c83dc5a47e3981 (patch) | |
| tree | 26fef61ba5f7d751e85c5da8403e2be9ab4f6d1e /test/ng/cacheFactorySpec.js | |
| parent | c0de8fb737d5d381e1ca5efc58c9ce5fcd860dd9 (diff) | |
| download | angular.js-1eb9e22d450aa0b5c2221313e8c83dc5a47e3981.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.js | 5 |
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'); |
