Skip to content

Commit 3dd5d49

Browse files
authored
Merge pull request rails#47606 from eileencodes/fix-schema-cache-file-test
Fix schema cache file test
2 parents 9898468 + 857b4af commit 3dd5d49

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

activerecord/test/cases/connection_adapters/schema_cache_test.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ def test_yaml_dump_and_load
4141

4242
def test_cache_path_can_be_in_directory
4343
cache = SchemaCache.new @connection
44-
filename = "some_dir/schema.json"
44+
tmp_dir = Dir.mktmpdir
45+
filename = File.join(tmp_dir, "schema.json")
46+
47+
assert_not File.exist?(filename)
4548
assert cache.dump_to(filename)
49+
assert File.exist?(filename)
4650
ensure
47-
File.delete(filename)
51+
FileUtils.rm_r(tmp_dir)
4852
end
4953

5054
def test_yaml_dump_and_load_with_gzip

0 commit comments

Comments
 (0)