Commit e933c559 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix the initialization of #key field in @new tag.

Add a smoke test to ensure we'll catch such a thing in the future.
parent b3d6a432
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ module JsDuck::Tag
      # unicode black star char
      # A :tooltip field gets injected to this signature in Process::Versions
      @signature = {:long => "★", :short => "★"}
      super
    end
  end
end
+28 −0
Original line number Diff line number Diff line
require "mini_parser"

describe JsDuck::Aggregator do
  def parse(string)
    Helper::MiniParser.parse(string)
  end

  def parse_member(string)
    parse(string)["global"][:members][0]
  end

  describe "method with @new" do
    let(:doc) do
      parse_member(<<-EOS)
        /**
         * Some function
         * @new
         */
        function bar() {}
      EOS
    end

    it "gets the :new flag set" do
      doc[:new].should == true
    end
  end

end