Commit 0b8e5875 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Speed up tests involving meta-tags.

The loading of all meta-tags at the start of several test-suites
slowed things down quite a bit.  Now only loading support for
@static in most places and only loading the full set of meta-tags
in one suite that tests all of them.

Also moving @markdown tag test to be together with other meta-tag tests.

Got the running time of tests down from 1.18 to 0.85 seconds.
That's about 1/4 faster. Not much, but it's a good goal to keep
the running time under a second.
parent c1c1bfd6
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -151,4 +151,20 @@ describe JsDuck::Aggregator do
    end
  end

  describe "class with @markdown" do
    before do
      @doc = parse(<<-EOS)[0]
        /**
         * @class MyClass
         * @markdown
         * Comment here.
         */
      EOS
    end

    it "does not show @markdown tag in docs" do
      @doc[:doc].should == "Comment here."
    end
  end

end
+1 −18
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ require "jsduck/source_file"

describe JsDuck::Aggregator do

  before do
  before(:all) do
    JsDuck::Logger.instance.set_warning(:alt_name, false)
  end

@@ -337,23 +337,6 @@ describe JsDuck::Aggregator do
    end
  end

  describe "class with @markdown" do
    before do
      @doc = parse(<<-EOS)[0]
        /**
         * @class MyClass
         * @markdown
         * Comment here.
         */
      EOS
    end

    it_should_behave_like "class"
    it "does not show @markdown tag in docs" do
      @doc[:doc].should == "Comment here."
    end
  end

  describe "member docs after class doc" do
    before do
      @classes = parse(<<-EOS)
+2 −1
Original line number Diff line number Diff line
require "jsduck/aggregator"
require "jsduck/source_file"
require "jsduck/tag/static"
require "jsduck/meta_tag_registry"

describe JsDuck::Aggregator do
  before(:all) do
    JsDuck::MetaTagRegistry.instance.load([:builtins])
    JsDuck::MetaTagRegistry.instance.register([JsDuck::Tag::Static.new])
  end

  def parse(string)
+2 −1
Original line number Diff line number Diff line
@@ -4,11 +4,12 @@ require "jsduck/class"
require "jsduck/relations"
require "jsduck/inherit_doc"
require "jsduck/logger"
require "jsduck/tag/static"
require "jsduck/meta_tag_registry"

describe JsDuck::Aggregator do
  before(:all) do
    JsDuck::MetaTagRegistry.instance.load([:builtins])
    JsDuck::MetaTagRegistry.instance.register([JsDuck::Tag::Static.new])
    JsDuck::Logger.instance.set_warning(:inheritdoc, false)
  end

+2 −1
Original line number Diff line number Diff line
require "jsduck/aggregator"
require "jsduck/source_file"
require "jsduck/tag/static"
require "jsduck/meta_tag_registry"

describe JsDuck::Aggregator do
  before(:all) do
    JsDuck::MetaTagRegistry.instance.load([:builtins])
    JsDuck::MetaTagRegistry.instance.register([JsDuck::Tag::Static.new])
  end

  def parse(string)