Move more fixtures to compile time
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
defmodule LastFm.Fixtures.Artist do
|
||||
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/last_fm"])
|
||||
|
||||
def get_info do
|
||||
Path.join([@fixtures_folder, "artist.getinfo.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
end
|
||||
# Cache fixtures at compile time to avoid repeated file I/O
|
||||
@get_info Path.join([@fixtures_folder, "artist.getinfo.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
def get_info, do: @get_info
|
||||
|
||||
def get_similar_artists do
|
||||
%{"similarartists" => %{"artist" => []}}
|
||||
|
||||
Reference in New Issue
Block a user