From d0360a4d5c024c85ecdd7a4eca72256712c4f9d3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 31 May 2007 17:31:33 +0000 Subject: Base.inspect handles Base itself and abstract_class? Don't use # since that notation's typically used for instances of a class, not the class itself. Closes #8490 [deepblue] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/base_test.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'activerecord/test') 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, %(#) + assert_equal %(#), topic.inspect end - def test_inspect_new + def test_inspect_new_instance assert_match /Topic id: nil/, Topic.new.inspect end -- cgit v1.2.3