Sha256: 4deb19f644d39c8a29e0f984b0b48329aa25120fac41ef1cf86fb4826fe1e34e

Contents?: true

Size: 1.4 KB

Versions: 68

Compression:

Stored size: 1.4 KB

Contents

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

describe YARD::Templates::Engine.template(:default, :tags) do
  before { Registry.clear }

  describe 'all known tags' do
    before do
      YARD.parse_string <<-'eof'
        # Comments
        # @abstract override me
        # @param [Hash] opts the options
        # @option opts :key ('') hello
        # @option opts :key2 (X) hello
        # @return [String] the result
        # @raise [Exception] Exception class
        # @deprecated for great justice
        # @see A
        # @see http://url.com
        # @see http://url.com Example
        # @author Name
        # @since 1.0
        # @version 1.0
        # @yield a block
        # @yieldparam [String] a a value
        # @yieldreturn [Hash] a hash
        # @example Wash your car
        #   car.wash
        # @example To kill a mockingbird
        #   a = String.new
        #   flip(a.reverse)
        def m(opts = {}) end
      eof
    end

    it "should render text format correctly" do
      text_equals(Registry.at('#m').format(text_options), :tag001)
    end
  end

  describe 'param tags on non-methods' do
    it 'should not display @param tags on non-method objects' do
      YARD.parse_string <<-'eof'
        # @param [#to_s] name the name
        module Foo; end
      eof

      proc = lambda { Registry.at('Foo').format(html_options) }
      proc.should_not raise_error(NoMethodError)
    end
  end
end

Version data entries

68 entries across 52 versions & 7 rubygems

Version Path
yard-0.8.7.6 spec/templates/tag_spec.rb
yard-0.8.7.5 spec/templates/tag_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
yard-0.8.7.4 spec/templates/tag_spec.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/templates/tag_spec.rb
yard-0.8.7.3 spec/templates/tag_spec.rb
yard-0.8.7.2 spec/templates/tag_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/spec/templates/tag_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/spec/templates/tag_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/spec/templates/tag_spec.rb
yard-0.8.7.1 spec/templates/tag_spec.rb