Sha256: 9f58feecae5dc2a0fc04fa469867e7ba7e90cf8ac7b9c810e6c843112042418d

Contents?: true

Size: 1012 Bytes

Versions: 21

Compression:

Stored size: 1012 Bytes

Contents

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

RSpec.describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ModuleHandler" do
  before(:all) { parse_file :module_handler_001, __FILE__ }

  it "parses a module block" do
    expect(Registry.at(:ModName)).not_to eq nil
    expect(Registry.at("ModName::OtherModName")).not_to eq nil
  end

  it "attaches docstring" do
    expect(Registry.at("ModName::OtherModName").docstring).to eq "Docstring"
  end

  it "handles any formatting" do
    expect(Registry.at(:StressTest)).not_to eq nil
  end

  it "handles complex module names" do
    expect(Registry.at("A::B")).not_to eq nil
  end

  it "handles modules in the form ::ModName" do
    expect(Registry.at("Kernel")).not_to be nil
  end

  it "lists mixins in proper order" do
    expect(Registry.at('D').mixins).to eq [P(:C), P(:B), P(:A)]
  end

  it "creates proper module when constant is in namespace" do
    expect(Registry.at('Q::FOO::A')).not_to be nil
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

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