diff options
| author | Misko Hevery | 2012-02-22 13:28:42 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-02-22 13:28:42 -0800 |
| commit | 80edcadb1dd418dcf5adf85704c6693940c8bb28 (patch) | |
| tree | 5741696b48468a3387b6763559bff6b2be0a150b /test/InjectorSpec.js | |
| parent | c27a56f4da9bf89e471ac6597c135e2f19814f17 (diff) | |
| download | angular.js-80edcadb1dd418dcf5adf85704c6693940c8bb28.tar.bz2 | |
feat($provide): added constant
Diffstat (limited to 'test/InjectorSpec.js')
| -rw-r--r-- | test/InjectorSpec.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js index e0cabbac..2ea5b66d 100644 --- a/test/InjectorSpec.js +++ b/test/InjectorSpec.js @@ -260,6 +260,29 @@ describe('injector', function() { }); describe('$provide', function() { + describe('constant', function() { + it('should create configuration injectable constants', function() { + var log = []; + createInjector([ + function($provide){ + $provide.constant('abc', 123); + $provide.constant({a: 'A', b:'B'}); + return function(a) { + log.push(a); + } + }, + function(abc) { + log.push(abc); + return function(b) { + log.push(b); + } + } + ]).get('abc'); + expect(log).toEqual([123, 'A', 'B']); + }); + }); + + describe('value', function() { it('should configure $provide values', function() { expect(createInjector([function($provide) { |
