diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-02 09:18:05 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-02 09:18:05 -0800 |
commit | 66245441d4471f29043433f6cf789498cf35b96c (patch) | |
tree | f3ac7db0c59f00d36baa7a82a006c7fd4cf0c135 /activesupport/test | |
parent | 2ee55557440a644453482a678e4ff08a4b5ebd3e (diff) | |
download | rails-66245441d4471f29043433f6cf789498cf35b96c.tar.gz rails-66245441d4471f29043433f6cf789498cf35b96c.tar.bz2 rails-66245441d4471f29043433f6cf789498cf35b96c.zip |
adding backwards compat for class cache references. <3<3
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/class_cache_test.rb | 14 | ||||
-rw-r--r-- | activesupport/test/dependencies_test.rb | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/activesupport/test/class_cache_test.rb b/activesupport/test/class_cache_test.rb index 3d3ae559e5..4d19e9841a 100644 --- a/activesupport/test/class_cache_test.rb +++ b/activesupport/test/class_cache_test.rb @@ -52,7 +52,9 @@ module ActiveSupport end def test_new - @cache.new ClassCacheTest + assert_deprecated do + @cache.new ClassCacheTest + end assert @cache.key?(ClassCacheTest.name) end @@ -61,9 +63,13 @@ module ActiveSupport assert !@cache.key?(ClassCacheTest.name) end - def test_new_returns_self - v = @cache.new ClassCacheTest.name - assert_equal @cache, v + def test_new_returns_proxy + v = nil + assert_deprecated do + v = @cache.new ClassCacheTest.name + end + + assert_equal ClassCacheTest, v.get end def test_anonymous_class_fail diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index b3ada53497..bc7f597f1d 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -479,13 +479,13 @@ class DependenciesTest < Test::Unit::TestCase with_loading 'dependencies' do c = ActiveSupport::Dependencies.ref("ServiceOne") service_one_first = ServiceOne - assert_equal service_one_first, c.get("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("ServiceOne") - assert_equal service_one_second, c.get("ServiceOne") + assert_not_equal service_one_first, c.get + assert_equal service_one_second, c.get end end |