diff options
author | Takehiro Adachi <takehiro0740@gmail.com> | 2013-03-18 15:45:39 +0900 |
---|---|---|
committer | Takehiro Adachi <takehiro0740@gmail.com> | 2013-03-18 15:45:39 +0900 |
commit | 4666108c686f0ccb51dde272eee101ecc6f389f6 (patch) | |
tree | 72db69d7901d47765b17eb85a8a2b3b1300a4b07 /activerecord/test/cases | |
parent | c4a7c31581c8386198317a2385f9c7d462c18497 (diff) | |
download | rails-4666108c686f0ccb51dde272eee101ecc6f389f6.tar.gz rails-4666108c686f0ccb51dde272eee101ecc6f389f6.tar.bz2 rails-4666108c686f0ccb51dde272eee101ecc6f389f6.zip |
move tests out from base_test.rb
These tests should be in inheritance_test.rb since its testing a
feature which is implemented in inheritance.rb
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 14 | ||||
-rw-r--r-- | activerecord/test/cases/inheritance_test.rb | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 960c27da3e..445322486c 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -307,20 +307,6 @@ class BasicsTest < ActiveRecord::TestCase assert_equal("last_read", ex.errors[0].attribute) end - def test_initialize_abstract_class - e = assert_raises(NotImplementedError) do - FirstAbstractClass.new - end - assert_equal("FirstAbstractClass is an abstract class and can not be instantiated.", e.message) - end - - def test_initialize_base - e = assert_raises(NotImplementedError) do - ActiveRecord::Base.new - end - assert_equal("ActiveRecord::Base is an abstract class and can not be instantiated.", e.message) - end - def test_create_after_initialize_without_block cb = CustomBulb.create(:name => 'Dude') assert_equal('Dude', cb.name) diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb index 0b9ccbf60a..99d54e7526 100644 --- a/activerecord/test/cases/inheritance_test.rb +++ b/activerecord/test/cases/inheritance_test.rb @@ -172,6 +172,20 @@ class InheritanceTest < ActiveRecord::TestCase assert_equal Firm, firm.class end + def test_new_with_abstract_class + e = assert_raises(NotImplementedError) do + AbstractCompany.new + end + assert_equal("AbstractCompany is an abstract class and can not be instantiated.", e.message) + end + + def test_new_with_ar_base + e = assert_raises(NotImplementedError) do + ActiveRecord::Base.new + end + assert_equal("ActiveRecord::Base is an abstract class and can not be instantiated.", e.message) + end + def test_new_with_invalid_type assert_raise(ActiveRecord::SubclassNotFound) { Company.new(:type => 'InvalidType') } end |