2010-04-01 03:45:16 -04:00
|
|
|
require File.expand_path '../xref_test_case', __FILE__
|
|
|
|
|
|
|
|
class TestRDocNormalClass < XrefTestCase
|
|
|
|
|
|
|
|
def test_ancestors_class
|
|
|
|
top_level = RDoc::TopLevel.new 'file.rb'
|
|
|
|
klass = top_level.add_class RDoc::NormalClass, 'Klass'
|
|
|
|
incl = RDoc::Include.new 'Incl', ''
|
|
|
|
|
|
|
|
sub_klass = klass.add_class RDoc::NormalClass, 'SubClass', 'Klass'
|
|
|
|
sub_klass.add_include incl
|
|
|
|
|
2010-12-19 22:22:49 -05:00
|
|
|
assert_equal [incl.name, klass], sub_klass.ancestors
|
2010-04-01 03:45:16 -04:00
|
|
|
end
|
|
|
|
|
2011-02-01 19:32:30 -05:00
|
|
|
def test_definition
|
|
|
|
c = RDoc::NormalClass.new 'C'
|
|
|
|
|
|
|
|
assert_equal 'class C', c.definition
|
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
end
|
|
|
|
|