Sha256: ed2bdc4951a00be92ce6fd2bd737aefa6426c8fd173513b90b34fd1465491bb2

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

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

RSpec.describe YARD::Templates::Engine.template(:default, :docstring) do
  before do
    Registry.clear
    YARD.parse_string <<-'eof'
      private
      # Comments
      # @abstract override this class
      # @author Test
      # @version 1.0
      # @see A
      # @see http://example.com Example
      class A < B
        # HI
        def method_missing(*args) end
        # @deprecated
        def a; end

        # constructor method!
        def initialize(test) end
      end

      class C < A; end

      class D
        # @private
        def initialize; end
      end
    eof
  end

  it "renders html format correctly" do
    html_equals(Registry.at('A').format(html_options), :class001)
  end

  it "renders text format correctly" do
    text_equals(Registry.at('A').format, :class001)
  end

  it "hides private constructors" do
    html_equals(Registry.at('D').format(html_options(:verifier => Verifier.new("!@private"))), :class002)
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

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