diff options
author | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-10-05 17:35:59 +0100 |
---|---|---|
committer | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-10-05 17:35:59 +0100 |
commit | 84eece0a823e9c601ea99a8709f24605a19bcbfd (patch) | |
tree | 12ac66c6404f35faddd06617987ad6db76b11406 /activesupport/test | |
parent | 19965402b2f868c79d78269ca17cb6282f271382 (diff) | |
parent | c495bfc127405f7ead0d1c275c4d75682a51e00e (diff) | |
download | rails-84eece0a823e9c601ea99a8709f24605a19bcbfd.tar.gz rails-84eece0a823e9c601ea99a8709f24605a19bcbfd.tar.bz2 rails-84eece0a823e9c601ea99a8709f24605a19bcbfd.zip |
Merge branch 'master' of git://github.com/rails/rails
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 |