From f4a904bc7176bf616d7c216adcd7e683cc94fe08 Mon Sep 17 00:00:00 2001 From: Shahryar Tavakkoli Date: Sat, 29 Jun 2024 16:44:02 +0330 Subject: [PATCH] VIP - Add tests for move_and_replace_build_files and Prepend compiled apps of an Library --- test/installer/library_handler_test.exs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/installer/library_handler_test.exs b/test/installer/library_handler_test.exs index a349aa8..96d7ea4 100644 --- a/test/installer/library_handler_test.exs +++ b/test/installer/library_handler_test.exs @@ -21,6 +21,18 @@ defmodule MishkaInstallerTest.Installer.LibraryHandlerTest do compile_type: :cmd }) + # move_and_replace_build_files + {:ok, moved_files} = + assert LibraryHandler.move_and_replace_build_files(%{ + app: "elixir-uuid", + version: "1.2.1" + }) + + # Prepend compiled apps of an Library + :ok = assert LibraryHandler.prepend_compiled_apps(moved_files) + + File.rm_rf(File.cwd!() <> "/_build/test/lib/elixir_uuid") + File.rm_rf(File.cwd!() <> "/deployment/test/extensions/#{temp_name}") end @@ -99,12 +111,7 @@ defmodule MishkaInstallerTest.Installer.LibraryHandlerTest do "/deployment/test/extensions" =~ assert LibraryHandler.extensions_path() end - test "Prepend compiled apps of an Library" do - # true = Code.prepend_path(path) - # assert to_charlist(path) in :code.get_path() - end - - test "Move and replace build files" do - # LibraryHandler.move_and_replace_build_files(app) + test "Mix command_execution error" do + {:error, _error} = assert LibraryHandler.command_execution(:mix, "", "") end end