Speed up tests by caching cover data

Suggested and executed by Claude
This commit is contained in:
Claudio Ortolina
2025-06-14 21:15:06 +03:00
parent 889c388d97
commit 07d9db6011
6 changed files with 21 additions and 11 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ defmodule MusicLibrary.Records.CoverTest do
describe "resize/1" do
test "it resizes to the desired size" do
cover_data = File.read!(marbles_cover_fixture())
# Use the cached cover data which is much faster than reading from disk
cover_data = marbles_cover_data()
{:ok, resized_cover} = Cover.resize(cover_data)
assert cover_data !== resized_cover
assert Cover.correct_size?(resized_cover)