Sha256: 634878e4f459a609f6656a77f6d1f3dc6d8fb7d1a61fbcfafa7352391ee9c411

Contents?: true

Size: 757 Bytes

Versions: 8

Compression:

Stored size: 757 Bytes

Contents

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

describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ExtendHandler" do
  before(:all) { parse_file :extend_handler_001, __FILE__ }

  it "includes modules at class scope" do
    expect(Registry.at(:B).class_mixins).to eq [P(:A)]
    expect(Registry.at(:B).instance_mixins).to be_empty
  end

  it "handles a module extending itself" do
    expect(Registry.at(:C).class_mixins).to eq [P(:C)]
    expect(Registry.at(:C).instance_mixins).to be_empty
  end

  it "extends module with correct namespace" do
    expect(Registry.at('Q::R::S').class_mixins.first.path).to eq 'A'
  end

  it "does not allow extending self if object is a class" do
    undoc_error "class Foo; extend self; end"
  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/extend_handler_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.1/spec/handlers/extend_handler_spec.rb
yard-0.9.5 spec/handlers/extend_handler_spec.rb
yard-0.9.4 spec/handlers/extend_handler_spec.rb
yard-0.9.3 spec/handlers/extend_handler_spec.rb
yard-0.9.2 spec/handlers/extend_handler_spec.rb
yard-0.9.1 spec/handlers/extend_handler_spec.rb
yard-0.9.0 spec/handlers/extend_handler_spec.rb