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.6 spec/tags/library_spec.rb
yard-0.8.7.5 spec/tags/library_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
yard-0.8.7.4 spec/tags/library_spec.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/tags/library_spec.rb
yard-0.8.7.3 spec/tags/library_spec.rb
yard-0.8.7.2 spec/tags/library_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/spec/tags/library_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/spec/tags/library_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/spec/tags/library_spec.rb
yard-0.8.7.1 spec/tags/library_spec.rb