Sha256: a56e71ae08b58a6ce50d19f14ae151da0a71fca7df781b13bc0dfd650a4e4bbd

Contents?: true

Size: 1.42 KB

Versions: 21

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true
require File.dirname(__FILE__) + '/spec_helper'

RSpec.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 "renders text format correctly" do
      text_equals(Registry.at('#m').format(text_options), :tag001)
    end
  end

  describe "param tags on non-methods" do
    it "does 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) }
      expect(proc).not_to raise_error
    end
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

Version Path
yard-0.9.24 spec/templates/tag_spec.rb
yard-0.9.23 spec/templates/tag_spec.rb
yard-0.9.22 spec/templates/tag_spec.rb
yard-0.9.21 spec/templates/tag_spec.rb
yard-0.9.20 spec/templates/tag_spec.rb
yard-0.9.19 spec/templates/tag_spec.rb
yard-0.9.16 spec/templates/tag_spec.rb
yard-0.9.15 spec/templates/tag_spec.rb
yard-0.9.14 spec/templates/tag_spec.rb
yard-0.9.13 spec/templates/tag_spec.rb
yard-0.9.12 spec/templates/tag_spec.rb
yard-0.9.11 spec/templates/tag_spec.rb
yard-0.9.10 spec/templates/tag_spec.rb
yard-0.9.9 spec/templates/tag_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/spec/templates/tag_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/spec/templates/tag_spec.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/spec/templates/tag_spec.rb
yard-0.9.8 spec/templates/tag_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/spec/templates/tag_spec.rb
yard-0.9.7 spec/templates/tag_spec.rb