aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2011-07-15 17:18:38 -0700
committerIgor Minar2011-07-16 01:12:29 -0700
commit9e37ebe635a37a12535922ac9902ebd492d7cba9 (patch)
tree34d2371c34ebcfc9fba0c60c04d289db572eab7b
parent345c01c81b35409c907bee7f70335b3c6f55bcb8 (diff)
downloadangular.js-9e37ebe635a37a12535922ac9902ebd492d7cba9.tar.bz2
test(ngdoc): add test for @ngdoc function
-rw-r--r--docs/spec/ngdocSpec.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index 6c6a93f2..a184c5df 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -496,6 +496,26 @@ describe('ngdoc', function(){
});
+ describe('function', function(){
+ it('should format', function(){
+ var doc = new Doc({
+ ngdoc:'function',
+ name:'some.name',
+ param: [
+ {name:'a', optional: true},
+ {name:'b', type: 'someType', optional: true, 'default': '"xxx"'},
+ {name:'c', type: 'string', description: 'param desc'}
+ ],
+ returns: {type: 'number', description: 'return desc'}
+ });
+ doc.html_usage_function(dom);
+ expect(dom).toContain('some.name([a][, b], c)'); //TODO(i) the comma position here is lame
+ expect(dom).toContain('param desc');
+ expect(dom).toContain('(optional="xxx")');
+ expect(dom).toContain('return desc');
+ });
+ });
+
describe('filter', function(){
it('should format', function(){
var doc = new Doc({