aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/collect.js6
-rw-r--r--docs/spec/collectSpec.js20
2 files changed, 8 insertions, 18 deletions
diff --git a/docs/collect.js b/docs/collect.js
index 5a5e3ee9..2cb85fe2 100644
--- a/docs/collect.js
+++ b/docs/collect.js
@@ -208,12 +208,12 @@ function propertyTag(doc, name, value) {
}
function returnsTag(doc, name, value) {
- var match = value.match(/^({(\S+)}\s*)?(.*)?/);
+ var match = value.match(/^{(\S+)}\s+(.*)?/);
if (match) {
var tag = {
- type: match[2],
- description: match[3] || false
+ type: match[1],
+ description: match[2] || false
};
} else {
throw "[" + doc.raw.file + ":" + doc.raw.line +
diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js
index 4d398be3..7777e8f4 100644
--- a/docs/spec/collectSpec.js
+++ b/docs/spec/collectSpec.js
@@ -161,24 +161,14 @@ describe('collect', function(){
});
describe('@returns', function() {
- it('should parse @returns', function() {
- expect(function() {TAG.returns(doc, 'returns', '');})
- .not.toThrow();
- });
-
- it('should parse @returns with type', function() {
- TAG.returns(doc, 'returns', '{string}');
- expect(doc.returns.type).toEqual('string');
- });
-
- it('should parse @returns with description', function() {
- TAG.returns(doc, 'returns', 'descrip tion');
- expect(doc.returns.description).toEqual('descrip tion');
+ it('should not parse @returns without type', function() {
+ expect(function() {TAG.returns(doc, 'returns', 'lala');})
+ .toThrow();
});
it('should parse @returns with type and description', function() {
- TAG.returns(doc, 'returns', '{string} description');
- expect(doc.returns).toEqual({type: 'string', description: 'description'});
+ TAG.returns(doc, 'returns', '{string} descrip tion');
+ expect(doc.returns).toEqual({type: 'string', description: 'descrip tion'});
});
});