diff --git a/test/fixtures/augmentstag3.js b/test/fixtures/augmentstag3.js new file mode 100644 index 00000000..80851817 --- /dev/null +++ b/test/fixtures/augmentstag3.js @@ -0,0 +1,18 @@ +// test to see that we can @augment multiple things (code allows for it) +/** @class */ +function Foo() { +} +/** A method. */ +Foo.prototype.method1 = function () {}; + +/** @class */ +function Bar() { +} +/** Another method. */ +Bar.prototype.method2 = function () {} + +/** @class + * @augments Foo + * @augments Bar */ +function FooBar() { +} diff --git a/test/specs/tags/augmentstag.js b/test/specs/tags/augmentstag.js index e03aae60..fabc2ee0 100644 --- a/test/specs/tags/augmentstag.js +++ b/test/specs/tags/augmentstag.js @@ -24,7 +24,13 @@ bazMethod3 = docSet.getByLongname('Baz#method3')[0], docSet2 = jasmine.getDocSetFromFile('test/fixtures/augmentstag2.js'), - qux = docSet2.getByLongname('Qux')[0]; + qux = docSet2.getByLongname('Qux')[0], + + docSet3 = jasmine.getDocSetFromFile('test/fixtures/augmentstag3.js'), + FooMethod1 = docSet3.getByLongname('Foo#method1')[0], + BarMethod2 = docSet3.getByLongname('Bar#method2')[0], + FooBarMethod1 = docSet3.getByLongname('FooBar#method1')[0], + FooBarMethod2 = docSet3.getByLongname('FooBar#method2')[0]; it('When a symbol has an @augments tag, the doclet has a augments property that includes that value.', function() { expect(typeof bar.augments).toBe('object'); @@ -82,4 +88,12 @@ expect(typeof qux.augments).toBe('object'); expect(qux.augments[0]).toBe('UndocumentedThing'); }); + + + it('When a symbol @augments multiple parents, it inherits methods from all parents', function() { + expect(FooBarMethod1).toBeDefined(); + expect(FooBarMethod2).toBeDefined(); + expect(FooBarMethod1.description).toBe(FooMethod1.description); + expect(FooBarMethod2.description).toBe(BarMethod2.description); + }); });