提交 bf159aa5 编写于 作者: F Franck Verrot

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

上级 b1bb9d17
......@@ -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 )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册