aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-xactiverecord/test/base_test.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index d74a7b82b5..a64f933f37 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -1680,12 +1680,18 @@ class BasicsTest < Test::Unit::TestCase
# "expected last count (#{counts.last}) to be <= first count (#{counts.first})"
#end
- def test_inspect
+ def test_inspect_class
+ assert_equal 'ActiveRecord::Base', ActiveRecord::Base.inspect
+ assert_equal 'LoosePerson(abstract)', LoosePerson.inspect
+ assert_match(/^Topic\(id: integer, title: string/, Topic.inspect)
+ end
+
+ def test_inspect_instance
topic = topics(:first)
- assert_equal topic.inspect, %(#<Topic id: 1, title: "The First Topic", author_name: "David", author_email_address: "david@loudthinking.com", written_on: "#{topic.written_on.to_s(:db)}", bonus_time: "#{topic.bonus_time.to_s(:db)}", last_read: "#{topic.last_read.to_s(:db)}", content: "Have a nice day", approved: false, replies_count: 1, parent_id: nil, type: nil>)
+ assert_equal %(#<Topic id: 1, title: "The First Topic", author_name: "David", author_email_address: "david@loudthinking.com", written_on: "#{topic.written_on.to_s(:db)}", bonus_time: "#{topic.bonus_time.to_s(:db)}", last_read: "#{topic.last_read.to_s(:db)}", content: "Have a nice day", approved: false, replies_count: 1, parent_id: nil, type: nil>), topic.inspect
end
- def test_inspect_new
+ def test_inspect_new_instance
assert_match /Topic id: nil/, Topic.new.inspect
end