File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Original file line Diff line number Diff line change @@ -307,20 +307,6 @@ def test_initialize_with_invalid_attribute
307
assert_equal ( "last_read" , ex . errors [ 0 ] . attribute )
307
assert_equal ( "last_read" , ex . errors [ 0 ] . attribute )
308
end
308
end
309
309
310
- def test_initialize_abstract_class
311
- e = assert_raises ( NotImplementedError ) do
312
- FirstAbstractClass . new
313
- end
314
- assert_equal ( "FirstAbstractClass is an abstract class and can not be instantiated." , e . message )
315
- end
316
-
317
- def test_initialize_base
318
- e = assert_raises ( NotImplementedError ) do
319
- ActiveRecord ::Base . new
320
- end
321
- assert_equal ( "ActiveRecord::Base is an abstract class and can not be instantiated." , e . message )
322
- end
323
-
324
def test_create_after_initialize_without_block
310
def test_create_after_initialize_without_block
325
cb = CustomBulb . create ( :name => 'Dude' )
311
cb = CustomBulb . create ( :name => 'Dude' )
326
assert_equal ( 'Dude' , cb . name )
312
assert_equal ( 'Dude' , cb . name )
Original file line number Original file line Diff line number Diff line change @@ -172,6 +172,20 @@ def test_inheritance_new_with_subclass
172
assert_equal Firm , firm . class
172
assert_equal Firm , firm . class
173
end
173
end
174
174
175
+ def test_new_with_abstract_class
176
+ e = assert_raises ( NotImplementedError ) do
177
+ AbstractCompany . new
178
+ end
179
+ assert_equal ( "AbstractCompany is an abstract class and can not be instantiated." , e . message )
180
+ end
181
+
182
+ def test_new_with_ar_base
183
+ e = assert_raises ( NotImplementedError ) do
184
+ ActiveRecord ::Base . new
185
+ end
186
+ assert_equal ( "ActiveRecord::Base is an abstract class and can not be instantiated." , e . message )
187
+ end
188
+
175
def test_new_with_invalid_type
189
def test_new_with_invalid_type
176
assert_raise ( ActiveRecord ::SubclassNotFound ) { Company . new ( :type => 'InvalidType' ) }
190
assert_raise ( ActiveRecord ::SubclassNotFound ) { Company . new ( :type => 'InvalidType' ) }
177
end
191
end
You can’t perform that action at this time.
0 commit comments