mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
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:
@@ -1,2 +1,3 @@
|
||||
class ClassFolder
|
||||
ConstantInClassFolder = 'indeed'
|
||||
end
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class ClassFolder::ClassFolderSubclass < ClassFolder
|
||||
ConstantInClassFolder
|
||||
end
|
||||
@@ -181,6 +181,15 @@ class DependenciesTest < Test::Unit::TestCase
|
||||
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
|
||||
with_loading 'autoloading_fixtures' do
|
||||
sibling = ModuleFolder::NestedClass.class_eval "NestedSibling"
|
||||
|
||||
Reference in New Issue
Block a user