From 9062996a0e6b449467f5b8ec06824086ca87f9cf Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 26 Oct 2011 21:36:19 -0700 Subject: feat(injector): support $inject(fn($service){}) function invocation --- test/InjectorSpec.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js index 46c9897b..6ac17876 100644 --- a/test/InjectorSpec.js +++ b/test/InjectorSpec.js @@ -83,6 +83,7 @@ describe('injector', function() { function fn(a, b, c, d) { args = [this, a, b, c, d]; + return a + b + c + d; } @@ -99,6 +100,11 @@ describe('injector', function() { }); + it('should invoke the passed in function with all of the dependencies as arguments', function(){ + expect(injector(['a', 'b', fn], [3, 4])).toEqual(10); + }); + + it('should fail with errors if not function or array', function(){ expect(function(){ injector.invoke({}, {}); -- cgit v1.2.3