aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/autoloading_fixtures
diff options
context:
space:
mode:
authorJan Habermann <jan@habermann.io>2018-10-18 19:05:20 +0200
committerJan Habermann <jan@habermann.io>2018-10-28 16:34:50 +0100
commite302725751fc4bdb26aa3d28ca5d934ec21319f9 (patch)
treedeebadcfbf219a1c38419a464cb636555773d7bf /activesupport/test/autoloading_fixtures
parent3295e23755744b7f9426d752481bb928fb02a89e (diff)
downloadrails-e302725751fc4bdb26aa3d28ca5d934ec21319f9.tar.gz
rails-e302725751fc4bdb26aa3d28ca5d934ec21319f9.tar.bz2
rails-e302725751fc4bdb26aa3d28ca5d934ec21319f9.zip
Improve the logic that detects non-autoloaded constants
If you require `nokogiri` from `app/models/user.rb`, dependencies.rb does not mark `Nokogiri` as an autoloaded constant, as expected. But the logic to detect these non-autoloaded constants is incomplete. See the tests defined in the patch for some cases incorrectly handled.
Diffstat (limited to 'activesupport/test/autoloading_fixtures')
-rw-r--r--activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb8
-rw-r--r--activesupport/test/autoloading_fixtures/nested_with_require_parent.rb5
2 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb b/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb
new file mode 100644
index 0000000000..f9d6e675d7
--- /dev/null
+++ b/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+require "dependencies/module_folder/lib_class"
+
+module ModuleFolder
+ class NestedWithRequire
+ end
+end
diff --git a/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb b/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb
new file mode 100644
index 0000000000..e8fb321077
--- /dev/null
+++ b/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class NestedWithRequireParent
+ ModuleFolder::NestedWithRequire
+end