aboutsummaryrefslogtreecommitdiffstats
path: root/test/InjectorSpec.js
diff options
context:
space:
mode:
authorIgor Minar2012-03-16 10:48:59 -0700
committerIgor Minar2012-03-16 10:52:40 -0700
commitf13dd3393dfb7a33565c9360342c193bc0bddcb6 (patch)
treefcf54fb63bb30dcf9e131c8d34d440b626019fa9 /test/InjectorSpec.js
parentbca96e7c7cc723a091241fddd6845d6de262a3c9 (diff)
downloadangular.js-f13dd3393dfb7a33565c9360342c193bc0bddcb6.tar.bz2
feat(injector): infer _foo_ as foo
this is to enable nicer tests: describe('fooSvc', function() { var fooSvc; beforeEach(inject(function(_fooSvc_) { fooSvc = _fooSvc_; })); it('should do this thing', function() { //test fooSvc }); });
Diffstat (limited to 'test/InjectorSpec.js')
-rw-r--r--test/InjectorSpec.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js
index cc5c5b50..16cf1524 100644
--- a/test/InjectorSpec.js
+++ b/test/InjectorSpec.js
@@ -147,6 +147,12 @@ describe('injector', function() {
});
+ it('should strip leading and trailing underscores from arg name during inference', function() {
+ function beforeEachFn(_foo_) { /* foo = _foo_ */ };
+ expect(inferInjectionArgs(beforeEachFn)).toEqual(['foo']);
+ });
+
+
it('should handle no arg functions', function() {
function $f_n0() {}
expect(inferInjectionArgs($f_n0)).toEqual([]);