From db2291d97529e6d8d5cd82eb8c44a172cf622ddf Mon Sep 17 00:00:00 2001 From: Dan Schultzer <1254724+danschultzer@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:36:28 -0700 Subject: [PATCH] Refactor test helper --- test/dialyxir/project_test.exs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/dialyxir/project_test.exs b/test/dialyxir/project_test.exs index 7816d8e..9e17c29 100644 --- a/test/dialyxir/project_test.exs +++ b/test/dialyxir/project_test.exs @@ -5,13 +5,17 @@ defmodule Dialyxir.ProjectTest do import ExUnit.CaptureIO, only: [capture_io: 1, capture_io: 2] defp in_project(app, f) when is_atom(app) do - Mix.Project.in_project(app, "test/fixtures/#{Atom.to_string(app)}", fn _ -> f.() end) + in_project(app, "test/fixtures/#{Atom.to_string(app)}", f) end defp in_project(apps, f) when is_list(apps) do path = Enum.map_join(apps, "/", &Atom.to_string/1) app = List.last(apps) - Mix.Project.in_project(app, "test/fixtures/#{path}", fn _ -> f.() end) + in_project(app, "test/fixtures/#{path}", f) + end + + defp in_project(app, path, f) do + Mix.Project.in_project(app, path, fn _ -> f.() end) end test "Default Project PLT File in _build dir" do