diff options
author | José Valim <jose.valim@gmail.com> | 2012-08-01 18:23:11 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-08-21 14:46:12 -0300 |
commit | a1687e48cba2f0447f02248939cde05502562e87 (patch) | |
tree | 8128aeed24a85510ed71093f7b1a09ba04d7d800 /activesupport/test | |
parent | 11bc3487ab0a9a99de2542f0aa2777c88c7c2198 (diff) | |
download | rails-a1687e48cba2f0447f02248939cde05502562e87.tar.gz rails-a1687e48cba2f0447f02248939cde05502562e87.tar.bz2 rails-a1687e48cba2f0447f02248939cde05502562e87.zip |
Make ActiveSupport::Autoload local
Previously, ActiveSupport::Autoload was global and reserved
for usage inside Rails. This pull request makes it local,
fixes its test (they were not being run because its file
was named wrongly) and make it part of Rails public API.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/autoload_test.rb (renamed from activesupport/test/autoload.rb) | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/activesupport/test/autoload.rb b/activesupport/test/autoload_test.rb index 5d8026a9ca..7d02d835a8 100644 --- a/activesupport/test/autoload.rb +++ b/activesupport/test/autoload_test.rb @@ -28,15 +28,6 @@ class TestAutoloadModule < ActiveSupport::TestCase assert_nothing_raised { ::Fixtures::Autoload::SomeClass } end - test ":eager constants can be triggered via ActiveSupport::Autoload.eager_autoload!" do - module ::Fixtures::Autoload - autoload :SomeClass, "fixtures/autoload/some_class" - end - ActiveSupport::Autoload.eager_autoload! - assert $LOADED_FEATURES.include?("fixtures/autoload/some_class.rb") - assert_nothing_raised { ::Fixtures::Autoload::SomeClass } - end - test "the location of autoloaded constants defaults to :name.underscore" do module ::Fixtures::Autoload autoload :SomeClass @@ -51,8 +42,7 @@ class TestAutoloadModule < ActiveSupport::TestCase autoload :SomeClass end - ActiveSupport::Autoload.eager_autoload! - assert $LOADED_FEATURES.include?("fixtures/autoload/some_class.rb") + ::Fixtures::Autoload.eager_load! assert_nothing_raised { ::Fixtures::Autoload::SomeClass } end |