Loading lib/jsduck/doc_type.rb +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ module JsDuck :css_mixin elsif doc_map[:cfg] :cfg elsif doc_map[:constructor] :method else code[:tagname] end Loading spec/aggregator_constructor_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,23 @@ describe JsDuck::Aggregator do it_should_behave_like "constructor" end describe "class with member containing @constructor" do let(:methods) do parse(<<-EOS)[0][:members][:method] /** * Comment here. */ MyClass = { /** * @constructor * This constructs the class * @param {Number} nr */ }; EOS end it_should_behave_like "constructor" end end spec/doc_type_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,10 @@ describe JsDuck::DocType do detect("/** @method */").should == :method end it "@constructor tag" do detect("/** @constructor */").should == :method end it "function declaration" do detect("/** */ function foo() {}").should == :method end Loading Loading
lib/jsduck/doc_type.rb +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ module JsDuck :css_mixin elsif doc_map[:cfg] :cfg elsif doc_map[:constructor] :method else code[:tagname] end Loading
spec/aggregator_constructor_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,23 @@ describe JsDuck::Aggregator do it_should_behave_like "constructor" end describe "class with member containing @constructor" do let(:methods) do parse(<<-EOS)[0][:members][:method] /** * Comment here. */ MyClass = { /** * @constructor * This constructs the class * @param {Number} nr */ }; EOS end it_should_behave_like "constructor" end end
spec/doc_type_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,10 @@ describe JsDuck::DocType do detect("/** @method */").should == :method end it "@constructor tag" do detect("/** @constructor */").should == :method end it "function declaration" do detect("/** */ function foo() {}").should == :method end Loading