From 607f136d52e984323cbe2938c04c660ca55a5039 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 28 Apr 2013 12:03:26 +0200 Subject: fixes a test, and explains why AR::AttributeMethods checks defined?(@attributes) in some places --- activerecord/test/cases/attribute_methods_test.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 387c741762..d9c032392d 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -141,13 +141,10 @@ class AttributeMethodsTest < ActiveRecord::TestCase assert_respond_to topic, :title end - # IRB inspects the return value of "MyModel.allocate" - # by inspecting it. + # IRB inspects the return value of "MyModel.allocate". def test_allocated_object_can_be_inspected topic = Topic.allocate - topic.instance_eval { @attributes = nil } - assert_nothing_raised { topic.inspect } - assert topic.inspect, "#" + assert_equal "#", topic.inspect end def test_array_content -- cgit v1.2.3