Skip to content
Browse files

Test AR::Base#inspect on an allocated object not yet initialized

  • Loading branch information...
1 parent b1bb9d1 commit bf159aa5fc9ed4d68c4975dab37dfaf58d29a08c @franckverrot franckverrot committed May 25, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/cases/attribute_methods_test.rb
View
8 activerecord/test/cases/attribute_methods_test.rb
@@ -109,6 +109,14 @@ def test_respond_to_with_allocated_object
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 )

0 comments on commit bf159aa

Please sign in to comment.
Something went wrong with that request. Please try again.