Sha256: 2762a3a0d64fc14fe9160fbbd97bfa3833c319966868fa98291fe89953d6ddfe

Contents?: true

Size: 1.09 KB

Versions: 67

Compression:

Stored size: 1.09 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe YARD::Tags::Library do
  def tag(docstring)
    Docstring.new(docstring).tags.first
  end

  describe '#see_tag' do
    it "should take a URL" do
      tag("@see http://example.com").name.should == "http://example.com"
    end

    it "should take an object path" do
      tag("@see String#reverse").name.should == "String#reverse"
    end

    it "should take a description after the url/object" do
      tag = tag("@see http://example.com An Example Site")
      tag.name.should == "http://example.com"
      tag.text.should == "An Example Site"
    end
  end

  describe '.define_tag' do
    it "should allow defining tags with '.' in the name (x.y.z defines method x_y_z)" do
      Tags::Library.define_tag("foo", 'x.y.z')
      Tags::Library.define_tag("foo2", 'x.y.zz', Tags::OverloadTag)
      Tags::Library.instance.method(:x_y_z_tag).should_not be_nil
      Tags::Library.instance.method(:x_y_zz_tag).should_not be_nil
      tag('@x.y.z foo bar').text.should == 'foo bar'
      tag('@x.y.zz foo(bar)').signature.should == 'foo(bar)'
    end
  end
end

Version data entries

67 entries across 51 versions & 7 rubygems

Version Path
yard-0.8.7 spec/tags/library_spec.rb
challah-1.0.0 vendor/bundle/gems/yard-0.8.6.1/spec/tags/library_spec.rb
yard-0.8.6.2 spec/tags/library_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6.1/spec/tags/library_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.5.2/spec/tags/library_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6/spec/tags/library_spec.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/yard-0.8.6.1/spec/tags/library_spec.rb
yard-0.8.6.1 spec/tags/library_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.6/spec/tags/library_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.5.2/spec/tags/library_spec.rb
yard-0.8.6 spec/tags/library_spec.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/spec/tags/library_spec.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/spec/tags/library_spec.rb
yard-0.8.5.2 spec/tags/library_spec.rb
yard-0.8.5.1 spec/tags/library_spec.rb
yard-0.8.5 spec/tags/library_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/spec/tags/library_spec.rb
yard-0.8.4.1 spec/tags/library_spec.rb
yard-0.8.4 spec/tags/library_spec.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/spec/tags/library_spec.rb