Track fixture files as external resources
This commit is contained in:
@@ -2,6 +2,7 @@ defmodule MusicBrainz.Fixtures.Artist do
|
||||
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/music_brainz"])
|
||||
|
||||
# Cache fixtures at compile time to avoid repeated file I/O
|
||||
@external_resource Path.join([@fixtures_folder, "artist - steven wilson.json"])
|
||||
@get_artist Path.join([@fixtures_folder, "artist - steven wilson.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@@ -2,6 +2,7 @@ defmodule MusicBrainz.Fixtures.Release do
|
||||
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/music_brainz"])
|
||||
|
||||
# Cache JSON fixtures at compile time to avoid repeated file I/O
|
||||
@external_resource Path.join([@fixtures_folder, "releases - queen - greatest hits.json"])
|
||||
@releases_queen_greatest_hits Path.join([
|
||||
@fixtures_folder,
|
||||
"releases - queen - greatest hits.json"
|
||||
@@ -9,10 +10,15 @@ defmodule MusicBrainz.Fixtures.Release do
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([@fixtures_folder, "releases - marillion - marbles.json"])
|
||||
@releases_marbles Path.join([@fixtures_folder, "releases - marillion - marbles.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([
|
||||
@fixtures_folder,
|
||||
"release - avantasia - the mystery of time.json"
|
||||
])
|
||||
@release_mystery_of_time Path.join([
|
||||
@fixtures_folder,
|
||||
"release - avantasia - the mystery of time.json"
|
||||
@@ -20,10 +26,15 @@ defmodule MusicBrainz.Fixtures.Release do
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([@fixtures_folder, "release - marillion - marbles.json"])
|
||||
@release_marbles Path.join([@fixtures_folder, "release - marillion - marbles.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([
|
||||
@fixtures_folder,
|
||||
"release_with_media - marillion - marbles.json"
|
||||
])
|
||||
@release_with_media_marbles Path.join([
|
||||
@fixtures_folder,
|
||||
"release_with_media - marillion - marbles.json"
|
||||
|
||||
@@ -2,6 +2,10 @@ defmodule MusicBrainz.Fixtures.ReleaseGroup do
|
||||
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/music_brainz"])
|
||||
|
||||
# Cache JSON fixtures at compile time to avoid repeated file I/O
|
||||
@external_resource Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group_search_results - marillion - marbles.json"
|
||||
])
|
||||
@release_group_search_results Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group_search_results - marillion - marbles.json"
|
||||
@@ -9,6 +13,10 @@ defmodule MusicBrainz.Fixtures.ReleaseGroup do
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group - avantasia - the mystery of time.json"
|
||||
])
|
||||
@mystery_of_time Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group - avantasia - the mystery of time.json"
|
||||
@@ -16,10 +24,15 @@ defmodule MusicBrainz.Fixtures.ReleaseGroup do
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([@fixtures_folder, "release_group - marillion - marbles.json"])
|
||||
@marbles Path.join([@fixtures_folder, "release_group - marillion - marbles.json"])
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
|
||||
@external_resource Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group_with_includes - mariusz duda - lockdown trilogy.json"
|
||||
])
|
||||
@lockdown_trilogy Path.join([
|
||||
@fixtures_folder,
|
||||
"release_group_with_includes - mariusz duda - lockdown trilogy.json"
|
||||
|
||||
Reference in New Issue
Block a user