diff options
author | Franck Verrot <franck@verrot.fr> | 2011-05-25 13:52:11 +0200 |
---|---|---|
committer | Franck Verrot <franck@verrot.fr> | 2011-05-25 13:53:51 +0200 |
commit | bf159aa5fc9ed4d68c4975dab37dfaf58d29a08c (patch) | |
tree | 40d4919df1b91b28ec69b995aea600793cd1d7c5 /activerecord/test | |
parent | b1bb9d17381c860653db50589774e83cb5c95293 (diff) | |
download | rails-bf159aa5fc9ed4d68c4975dab37dfaf58d29a08c.tar.gz rails-bf159aa5fc9ed4d68c4975dab37dfaf58d29a08c.tar.bz2 rails-bf159aa5fc9ed4d68c4975dab37dfaf58d29a08c.zip |
Test AR::Base#inspect on an allocated object not yet initialized
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 5074ae50ab..54c4d4ae90 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -109,6 +109,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase assert_respond_to topic, :title end + # IRB inspects the return value of "MyModel.allocate" + # by inspecting it. + def test_allocated_object_can_be_inspected + topic = Topic.allocate + assert_nothing_raised { topic.inspect } + assert topic.inspect, "#<Topic not initialized>" + end + def test_array_content topic = Topic.new topic.content = %w( one two three ) |