revert ae54c06bb4bd2389d6eb1502b842c6b632e12e40
[akkoma] / test / pleroma / utils_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.UtilsTest do
6 use ExUnit.Case, async: true
7
8 describe "tmp_dir/1" do
9 test "returns unique temporary directory" do
10 {:ok, path} = Pleroma.Utils.tmp_dir("emoji")
11 assert path =~ ~r/\/emoji-(.*)-#{:os.getpid()}-(.*)/
12 File.rm_rf(path)
13 end
14 end
15
16 describe "compile_dir/1" do
17 test "recursively compiles directories" do
18 {:ok, [DynamicModule.First, DynamicModule.Second], []} =
19 Pleroma.Utils.compile_dir("test/fixtures/runtime_modules")
20 end
21 end
22 end