diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-11 21:38:49 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-11 21:38:49 -0200 |
commit | 64281fb6e742fddd4a1f67abfe5554a84349e8b7 (patch) | |
tree | fc04e7c654e18e33ef474d630a272d349b687bd4 /activerecord/test/cases | |
parent | 87a7e8752dcba5179f75a77b000d2e7eec29c736 (diff) | |
download | rails-64281fb6e742fddd4a1f67abfe5554a84349e8b7.tar.gz rails-64281fb6e742fddd4a1f67abfe5554a84349e8b7.tar.bz2 rails-64281fb6e742fddd4a1f67abfe5554a84349e8b7.zip |
Add :nsec format only for Ruby 1.9
Ruby 1.8 does not support this format in Time, so the format will only
be added to the available date formats on Ruby 1.9. Changelog entry was
changed to explain that as well.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 5631ac9ce2..2324704e15 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -2172,11 +2172,15 @@ class BasicsTest < ActiveRecord::TestCase end def test_cache_key_format_for_existing_record_with_updated_at_1 + return skip "Only in Ruby 1.9" if RUBY_VERSION < '1.9' + dev = CachedDeveloper.first assert_equal "cached_developers/#{dev.id}-#{dev.updated_at.utc.to_s(:nsec)}", dev.cache_key end def test_cache_key_changes_when_child_touched + return skip "Only in Ruby 1.9" if RUBY_VERSION < '1.9' + old_timestamp_format = Car.cache_timestamp_format Car.cache_timestamp_format = :nsec car = Car.create |