aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-06-05 20:33:53 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-06-05 22:05:58 -0700
commitfd1a5041362f5e65b813b7938d477143bd82de40 (patch)
tree5365eede7fe25b23d2a3f37beb21c11ddad281b0 /activesupport/test
parent35ae42be4f9e23ae954e4705276b460998cb401b (diff)
downloadrails-fd1a5041362f5e65b813b7938d477143bd82de40.tar.gz
rails-fd1a5041362f5e65b813b7938d477143bd82de40.tar.bz2
rails-fd1a5041362f5e65b813b7938d477143bd82de40.zip
ActiveSupport::Dependencies.constantize shortcut for caching named constant lookups
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/dependencies_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 15543e07c3..5422c75f5f 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -446,6 +446,12 @@ class DependenciesTest < Test::Unit::TestCase
end
end
+ def test_constantize_shortcut_for_cached_constant_lookups
+ with_loading 'dependencies' do
+ assert_equal ServiceOne, ActiveSupport::Dependencies.constantize("ServiceOne")
+ end
+ end
+
def test_nested_load_error_isnt_rescued
with_loading 'dependencies' do
assert_raise(MissingSourceFile) do