Test autoloading nested subclass of parent.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2006-11-16 22:50:46 +00:00
parent 1d31a043e0
commit 615d05f5de
3 changed files with 13 additions and 0 deletions

@ -1,2 +1,3 @@
class ClassFolder class ClassFolder
ConstantInClassFolder = 'indeed'
end end

@ -0,0 +1,3 @@
class ClassFolder::ClassFolderSubclass < ClassFolder
ConstantInClassFolder
end

@ -181,6 +181,15 @@ def test_class_with_nested_inline_class
end end
end end
def test_class_with_nested_inline_subclass_of_parent
with_loading 'autoloading_fixtures' do
assert_kind_of Class, ClassFolder::ClassFolderSubclass
assert_kind_of Class, ClassFolder
assert_equal 'indeed', ClassFolder::ClassFolderSubclass::ConstantInClassFolder
Object.send :remove_const, :ClassFolder
end
end
def test_nested_class_can_access_sibling def test_nested_class_can_access_sibling
with_loading 'autoloading_fixtures' do with_loading 'autoloading_fixtures' do
sibling = ModuleFolder::NestedClass.class_eval "NestedSibling" sibling = ModuleFolder::NestedClass.class_eval "NestedSibling"