diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-18 07:24:03 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-18 07:24:03 +0000 |
commit | 4d753adeaf623a341daca7f008c66034c69ba7a0 (patch) | |
tree | 68bc58fcca584a87b1cb6476dc04c3577e865f4a /activerecord/test | |
parent | 83318c7e8ad05131da1f031e3bef19459dca57fa (diff) | |
download | rails-4d753adeaf623a341daca7f008c66034c69ba7a0.tar.gz rails-4d753adeaf623a341daca7f008c66034c69ba7a0.tar.bz2 rails-4d753adeaf623a341daca7f008c66034c69ba7a0.zip |
Pay tribute to timezones. Tune #inspect style.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 152355c9dd..60e48c763b 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1645,20 +1645,20 @@ class BasicsTest < Test::Unit::TestCase # assert counts.last <= counts.first, # "expected last count (#{counts.last}) to be <= first count (#{counts.first})" #end - + def test_inspect 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: "2003-07-16 07:28:11", bonus_time: "2000-01-01 06:28:00", last_read: "2004-04-15", content: "Have a nice day", approved: false, replies_count: 1, parent_id: nil, type: nil>' + 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>) end - + def test_attribute_for_inspect t = topics(:first) t.content = %(This is some really long content, longer than 50 characters, so I can test that text is truncated correctly by the new ActiveRecord::Base#inspect method! Yay! BOOM!) - - assert_equal t.attribute_for_inspect(:written_on), '"' + t.written_on.to_s(:db) + '"' - assert_equal t.attribute_for_inspect(:content), '"This is some really long content, longer than 50 ch..."' + + assert_equal %("#{t.written_on.to_s(:db)}"), t.attribute_for_inspect(:written_on) + assert_equal '"This is some really long content, longer than 50 ch..."', t.attribute_for_inspect(:content) end - + private def assert_readers(model, exceptions) expected_readers = Set.new(model.column_names - ['id']) |