diff --git a/spec/aggregator_private_spec.rb b/spec/aggregator_private_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..efb078c596c12106a778f5628825b2878a3411af --- /dev/null +++ b/spec/aggregator_private_spec.rb @@ -0,0 +1,41 @@ +require "jsduck/aggregator" + +describe JsDuck::Aggregator do + + def parse(string) + agr = JsDuck::Aggregator.new + agr.parse(string) + agr.result + end + + shared_examples_for "private" do + before do + @doc = parse("/**\n * #{@tagname}\n */")[0] + end + + it "marks item as private" do + @doc[:private].should == true + end + end + + describe "@private" do + before { @tagname = "@private" } + it_should_behave_like "private" + end + + describe "@hide" do + before { @tagname = "@hide" } + it_should_behave_like "private" + end + + describe "@ignore" do + before { @tagname = "@ignore" } + it_should_behave_like "private" + end + + describe "@protected" do + before { @tagname = "@protected" } + it_should_behave_like "private" + end + +end diff --git a/test/tc_jsduck.rb b/test/tc_jsduck.rb index dbec9aee4ba2d2573c25a9f417cd92ea9173166a..43417ccfb391d427eaaf0feced84df7a9f6e93d2 100644 --- a/test/tc_jsduck.rb +++ b/test/tc_jsduck.rb @@ -25,12 +25,5 @@ class TestJsDuck < Test::Unit::TestCase assert_equal("Function", docs[0][:type]) end - def test_visibility_modifiers - ["@private", "@hide", "@ignore", "@protected"].each do |tagname| - docs = JsDuck.parse("/**\n * #{tagname}\n */"); - assert_equal(true, docs[0][:private]) - end - end - end