Loading spec/aggregator_private_spec.rb 0 → 100644 +41 −0 Original line number Diff line number Diff line 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 test/tc_jsduck.rb +0 −7 Original line number Diff line number Diff line Loading @@ -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 Loading
spec/aggregator_private_spec.rb 0 → 100644 +41 −0 Original line number Diff line number Diff line 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
test/tc_jsduck.rb +0 −7 Original line number Diff line number Diff line Loading @@ -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