Sha256: ca7433439da9e69870d0b7fad274be4aa823fa7c336ad322f7e7bf97d53a195f

Contents?: true

Size: 975 Bytes

Versions: 8

Compression:

Stored size: 975 Bytes

Contents

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

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

8 entries across 7 versions & 2 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/yard-0.9.2/spec/handlers/module_handler_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.1/spec/handlers/module_handler_spec.rb
yard-0.9.5 spec/handlers/module_handler_spec.rb
yard-0.9.4 spec/handlers/module_handler_spec.rb
yard-0.9.3 spec/handlers/module_handler_spec.rb
yard-0.9.2 spec/handlers/module_handler_spec.rb
yard-0.9.1 spec/handlers/module_handler_spec.rb
yard-0.9.0 spec/handlers/module_handler_spec.rb