Sha256: 271b005dd98f9b22ecf4d5f7d60eccc32b690d19539b09796d4ca913c732c19d

Contents?: true

Size: 780 Bytes

Versions: 3

Compression:

Stored size: 780 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 "should include modules at class scope" do
    Registry.at(:B).class_mixins.should == [P(:A)]
    Registry.at(:B).instance_mixins.should be_empty
  end

  it "should handle a module extending itself" do
    Registry.at(:C).class_mixins.should == [P(:C)]
    Registry.at(:C).instance_mixins.should be_empty
  end

  it "should extend module with correct namespace" do
    Registry.at('Q::R::S').class_mixins.first.path.should == 'A'
  end

  it "should not allow extending self if object is a class" do
    undoc_error "class Foo; extend self; end"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deg-yard-0.8.7.4 spec/handlers/extend_handler_spec.rb
deg-yard-0.8.7.3 spec/handlers/extend_handler_spec.rb
deg-yard-0.8.7.1 spec/handlers/extend_handler_spec.rb