Use aliases
This commit is contained in:
@@ -2,13 +2,14 @@ defmodule MusicLibrary.Records.CoverTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
import MusicLibrary.Fixtures.Records
|
||||
alias MusicLibrary.Records.Cover
|
||||
|
||||
describe "resize/1" do
|
||||
test "it resizes to the desired size" do
|
||||
cover_data = File.read!(marbles_cover_fixture())
|
||||
{:ok, resized_cover} = MusicLibrary.Records.Cover.resize(cover_data)
|
||||
{:ok, resized_cover} = Cover.resize(cover_data)
|
||||
assert cover_data !== resized_cover
|
||||
assert MusicLibrary.Records.Cover.correct_size?(resized_cover)
|
||||
assert Cover.correct_size?(resized_cover)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,6 +16,8 @@ defmodule MusicLibrary.DataCase do
|
||||
|
||||
use ExUnit.CaseTemplate
|
||||
|
||||
alias Ecto.Adapters.SQL.Sandbox
|
||||
|
||||
using do
|
||||
quote do
|
||||
alias MusicLibrary.Repo
|
||||
@@ -36,8 +38,8 @@ defmodule MusicLibrary.DataCase do
|
||||
Sets up the sandbox based on the test tags.
|
||||
"""
|
||||
def setup_sandbox(tags) do
|
||||
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
|
||||
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
|
||||
pid = Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
|
||||
on_exit(fn -> Sandbox.stop_owner(pid) end)
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
||||
Reference in New Issue
Block a user