diff options
Diffstat (limited to 'activestorage/test/models')
-rw-r--r-- | activestorage/test/models/blob_test.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activestorage/test/models/blob_test.rb b/activestorage/test/models/blob_test.rb index 54cf9e2b8a..b7b37bacf5 100644 --- a/activestorage/test/models/blob_test.rb +++ b/activestorage/test/models/blob_test.rb @@ -104,14 +104,12 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase end end - test "open in a custom tempdir" do - tempdir = Dir.mktmpdir - - create_file_blob(filename: "racecar.jpg").open(tempdir: tempdir) do |file| + test "open in a custom tmpdir" do + create_file_blob(filename: "racecar.jpg").open(tmpdir: tmpdir = Dir.mktmpdir) do |file| assert file.binmode? assert_equal 0, file.pos assert_match(/\.jpg\z/, file.path) - assert file.path.starts_with?(tempdir) + assert file.path.starts_with?(tmpdir) assert_equal file_fixture("racecar.jpg").binread, file.read, "Expected downloaded file to match fixture file" end end |