Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 4666108c686f0ccb51dde272eee101ecc6f389f6 1 parent c4a7c31
@take take authored
View
14 activerecord/test/cases/base_test.rb
@@ -307,20 +307,6 @@ def test_initialize_with_invalid_attribute
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)
View
14 activerecord/test/cases/inheritance_test.rb
@@ -172,6 +172,20 @@ def test_inheritance_new_with_subclass
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
Please sign in to comment.
Something went wrong with that request. Please try again.