diff options
author | wycats <wycats@gmail.com> | 2010-06-04 17:28:04 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-04 20:11:06 -0700 |
commit | a6b39428431abeaa0251bbf4b6582e578f81783f (patch) | |
tree | a85e09146a4e046cc69485df35c6b5bcea0bef8e /activesupport/test | |
parent | 16ee4b4d1b125bd3edb5c191d58c7afdf6d3232e (diff) | |
download | rails-a6b39428431abeaa0251bbf4b6582e578f81783f.tar.gz rails-a6b39428431abeaa0251bbf4b6582e578f81783f.tar.bz2 rails-a6b39428431abeaa0251bbf4b6582e578f81783f.zip |
Optimize LookupContext
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/dependencies_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 75ff88505d..15543e07c3 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -431,6 +431,21 @@ class DependenciesTest < Test::Unit::TestCase end end + def test_references_should_work + with_loading 'dependencies' do + root = ActiveSupport::Dependencies.load_paths.first + c = ActiveSupport::Dependencies.ref("ServiceOne") + service_one_first = ServiceOne + assert_equal service_one_first, c.get + ActiveSupport::Dependencies.clear + assert ! defined?(ServiceOne) + + service_one_second = ServiceOne + assert_not_equal service_one_first, c.get + assert_equal service_one_second, c.get + end + end + def test_nested_load_error_isnt_rescued with_loading 'dependencies' do assert_raise(MissingSourceFile) do |