aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRicardo Díaz <ricardotk002@gmail.com>2019-02-13 22:11:36 -0500
committerRicardo Díaz <ricardotk002@gmail.com>2019-02-13 22:56:34 -0500
commitdf29b6643b116502eebdf434f9d7d23187b1b156 (patch)
tree417fbee3cceddecbed17a507e384172b5057b340 /activesupport/test
parentac68550ae6d117b1d257f5df38ba76e03b7e2cf4 (diff)
downloadrails-df29b6643b116502eebdf434f9d7d23187b1b156.tar.gz
rails-df29b6643b116502eebdf434f9d7d23187b1b156.tar.bz2
rails-df29b6643b116502eebdf434f9d7d23187b1b156.zip
Use Dir#children and Dir#each_child instead of excluding "." and ".."
Both methods were introduced in Ruby 2.5 and fit this use case very nicely: listing a directory's entries excluding the "." and ".." nodes. The private method #exclude_from was removed as it no longer serves its original purpose.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/cache/stores/file_store_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/test/cache/stores/file_store_test.rb b/activesupport/test/cache/stores/file_store_test.rb
index f6855bb308..0364d9ab64 100644
--- a/activesupport/test/cache/stores/file_store_test.rb
+++ b/activesupport/test/cache/stores/file_store_test.rb
@@ -101,7 +101,7 @@ class FileStoreTest < ActiveSupport::TestCase
end
assert File.exist?(cache_dir), "Parent of top level cache dir was deleted!"
assert File.exist?(sub_cache_dir), "Top level cache dir was deleted!"
- assert_empty Dir.entries(sub_cache_dir).reject { |f| ActiveSupport::Cache::FileStore::EXCLUDED_DIRS.include?(f) }
+ assert_empty Dir.children(sub_cache_dir)
end
def test_log_exception_when_cache_read_fails