diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 11:02:02 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-24 11:08:16 +0000 |
commit | 800f0a6eb60c11575e55366c104d1e2d3e963d16 (patch) | |
tree | e472771c09910305a948b03fe33cdfa3a4d8579f /activerecord/test/cases | |
parent | 0e3e34f0eba32ebc561f56e8eda22ed9b8ad76c7 (diff) | |
download | rails-800f0a6eb60c11575e55366c104d1e2d3e963d16.tar.gz rails-800f0a6eb60c11575e55366c104d1e2d3e963d16.tar.bz2 rails-800f0a6eb60c11575e55366c104d1e2d3e963d16.zip |
Add deprecation for the change to the active_record load hook
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/inclusion_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index 4b3320cf04..374e4e01d3 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -74,6 +74,20 @@ class InclusionUnitTest < ActiveRecord::TestCase def test_included_twice @klass.send :include, ActiveRecord::Model end + + def test_deprecation_proxy + assert_equal ActiveRecord::Model.name, ActiveRecord::Model::DeprecationProxy.name + assert_equal ActiveRecord::Base.superclass, assert_deprecated { ActiveRecord::Model::DeprecationProxy.superclass } + + sup = nil + ActiveSupport.on_load(:__test_active_record_model_deprecation) do + sup = superclass + end + assert_deprecated do + ActiveSupport.run_load_hooks(:__test_active_record_model_deprecation, ActiveRecord::Model::DeprecationProxy) + end + assert_equal ActiveRecord::Base.superclass, sup + end end class InclusionFixturesTest < ActiveRecord::TestCase |