diff options
author | Manuel Menezes de Sequeira <MMSequeira@gmail.com> | 2011-10-05 22:14:49 +0100 |
---|---|---|
committer | Manuel Menezes de Sequeira <MMSequeira@gmail.com> | 2011-10-05 22:14:49 +0100 |
commit | 07343d2974ab77bfd21c0f35930cd394ba5b164e (patch) | |
tree | c64f8b54507d41ccb2c59cb096ee8b1f2a31e2df /activesupport/test | |
parent | 8d775d5f1d58e5c0d881383e8c6e869d1d360c8c (diff) | |
parent | d6c7185d77158caee933e84b247e37bb6a67bf58 (diff) | |
download | rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.gz rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.bz2 rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 8 | ||||
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 3 | ||||
-rw-r--r-- | activesupport/test/rescuable_test.rb | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index b692a41312..cb5362525f 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -566,6 +566,14 @@ class FileStoreTest < ActiveSupport::TestCase assert path.split('/').all? { |dir_name| dir_name.size <= ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE} assert_equal 'B', File.basename(path) end + + # If nothing has been stored in the cache, there is a chance the cache directory does not yet exist + # Ensure delete_matched gracefully handles this case + def test_delete_matched_when_cache_directory_does_not_exist + assert_nothing_raised(Exception) do + ActiveSupport::Cache::FileStore.new('/test/cache/directory').delete_matched(/does_not_exist/) + end + end end class MemoryStoreTest < ActiveSupport::TestCase diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index c4c4381957..ab9be4b18b 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -764,7 +764,10 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase def test_case_equality assert Time === Time.utc(2000) assert Time === ActiveSupport::TimeWithZone.new(Time.utc(2000), ActiveSupport::TimeZone['UTC']) + assert Time === Class.new(Time).utc(2000) assert_equal false, Time === DateTime.civil(2000) + assert_equal false, Class.new(Time) === Time.utc(2000) + assert_equal false, Class.new(Time) === ActiveSupport::TimeWithZone.new(Time.utc(2000), ActiveSupport::TimeZone['UTC']) end def test_all_day diff --git a/activesupport/test/rescuable_test.rb b/activesupport/test/rescuable_test.rb index bf4f5265ef..c28ffa50f2 100644 --- a/activesupport/test/rescuable_test.rb +++ b/activesupport/test/rescuable_test.rb @@ -70,7 +70,7 @@ class CoolStargate < Stargate end -class RescueableTest < Test::Unit::TestCase +class RescuableTest < Test::Unit::TestCase def setup @stargate = Stargate.new @cool_stargate = CoolStargate.new |