Loading spec/doc_formatter_spec.rb +17 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,10 @@ describe JsDuck::DocFormatter do :name => "Context", :members => { :method => [{:name => "bar", :tagname => :method}] } }, :statics => { :method => [{:name => "id", :tagname => :method}], }, }), JsDuck::Class.new({ :name => 'Ext.Msg' Loading @@ -21,6 +24,9 @@ describe JsDuck::DocFormatter do :members => { :cfg => [{:name => "bar", :tagname => :cfg}], }, :statics => { :method => [{:name => "id", :tagname => :method}], }, :alternateClassNames => ["FooBar"] }), ]) Loading @@ -40,11 +46,21 @@ describe JsDuck::DocFormatter do 'Look at <a href="Foo#cfg-bar">Foo.bar</a>' end it "replaces {@link Foo#id} with link to static class member" do @formatter.replace("Look at {@link Foo#id}").should == 'Look at <a href="Foo#method-id">Foo.id</a>' end it "uses context to replace {@link #bar} with link to class member" do @formatter.replace("Look at {@link #bar}").should == 'Look at <a href="Context#method-bar">bar</a>' end it "uses context to replace {@link #id} with link to static class member" do @formatter.replace("Look at {@link #id}").should == 'Look at <a href="Context#method-id">id</a>' end it "allows use of custom link text" do @formatter.replace("Look at {@link Foo link text}").should == 'Look at <a href="Foo">link text</a>' Loading Loading
spec/doc_formatter_spec.rb +17 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,10 @@ describe JsDuck::DocFormatter do :name => "Context", :members => { :method => [{:name => "bar", :tagname => :method}] } }, :statics => { :method => [{:name => "id", :tagname => :method}], }, }), JsDuck::Class.new({ :name => 'Ext.Msg' Loading @@ -21,6 +24,9 @@ describe JsDuck::DocFormatter do :members => { :cfg => [{:name => "bar", :tagname => :cfg}], }, :statics => { :method => [{:name => "id", :tagname => :method}], }, :alternateClassNames => ["FooBar"] }), ]) Loading @@ -40,11 +46,21 @@ describe JsDuck::DocFormatter do 'Look at <a href="Foo#cfg-bar">Foo.bar</a>' end it "replaces {@link Foo#id} with link to static class member" do @formatter.replace("Look at {@link Foo#id}").should == 'Look at <a href="Foo#method-id">Foo.id</a>' end it "uses context to replace {@link #bar} with link to class member" do @formatter.replace("Look at {@link #bar}").should == 'Look at <a href="Context#method-bar">bar</a>' end it "uses context to replace {@link #id} with link to static class member" do @formatter.replace("Look at {@link #id}").should == 'Look at <a href="Context#method-id">id</a>' end it "allows use of custom link text" do @formatter.replace("Look at {@link Foo link text}").should == 'Look at <a href="Foo">link text</a>' Loading