Loading spec/aggregator_cfgs_and_properties_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -176,4 +176,20 @@ describe JsDuck::Aggregator do it_should_behave_like "cfg or property String type" end describe "property with @static" do before do @doc = parse(<<-EOS)[0] /** * @property * @static */ foo: "", EOS end it_should_behave_like "property" it "detects property as static" do @doc[:static].should == true end end end spec/aggregator_methods_and_events_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,22 @@ describe JsDuck::Aggregator do it_should_behave_like "has return" end describe "method with @static" do before do @doc = parse(<<-EOS)[0] /** * Some function * @static */ function foo() {} EOS end it_should_behave_like "method documentation" it "detects method as static" do @doc[:static].should == true end end describe "method without doc-comment" do before do @docs = parse(<<-EOS) Loading test/tc_jsduck.rb +0 −16 Original line number Diff line number Diff line Loading @@ -32,21 +32,5 @@ class TestJsDuck < Test::Unit::TestCase end end def test_static_method docs = JsDuck.parse("/** * @method * @static */"); assert_equal(true, docs[0][:static]) end def test_static_property docs = JsDuck.parse("/** * @property * @static */"); assert_equal(true, docs[0][:static]) end end Loading
spec/aggregator_cfgs_and_properties_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -176,4 +176,20 @@ describe JsDuck::Aggregator do it_should_behave_like "cfg or property String type" end describe "property with @static" do before do @doc = parse(<<-EOS)[0] /** * @property * @static */ foo: "", EOS end it_should_behave_like "property" it "detects property as static" do @doc[:static].should == true end end end
spec/aggregator_methods_and_events_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,22 @@ describe JsDuck::Aggregator do it_should_behave_like "has return" end describe "method with @static" do before do @doc = parse(<<-EOS)[0] /** * Some function * @static */ function foo() {} EOS end it_should_behave_like "method documentation" it "detects method as static" do @doc[:static].should == true end end describe "method without doc-comment" do before do @docs = parse(<<-EOS) Loading
test/tc_jsduck.rb +0 −16 Original line number Diff line number Diff line Loading @@ -32,21 +32,5 @@ class TestJsDuck < Test::Unit::TestCase end end def test_static_method docs = JsDuck.parse("/** * @method * @static */"); assert_equal(true, docs[0][:static]) end def test_static_property docs = JsDuck.parse("/** * @property * @static */"); assert_equal(true, docs[0][:static]) end end