aboutsummaryrefslogtreecommitdiffstats
path: root/test/auto/injectorSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/auto/injectorSpec.js')
-rw-r--r--test/auto/injectorSpec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js
index d2a63789..6f84897b 100644
--- a/test/auto/injectorSpec.js
+++ b/test/auto/injectorSpec.js
@@ -394,6 +394,20 @@ describe('injector', function() {
});
+ it('should configure $provide using an array', function() {
+ function Type(PREFIX) {
+ this.prefix = PREFIX;
+ };
+ Type.prototype.$get = function() {
+ return this.prefix + 'def';
+ };
+ expect(createInjector([function($provide) {
+ $provide.constant('PREFIX', 'abc');
+ $provide.provider('value', ['PREFIX', Type]);
+ }]).get('value')).toEqual('abcdef');
+ });
+
+
it('should configure a set of providers', function() {
expect(createInjector([function($provide) {
$provide.provider({value: valueFn({$get:Array})});