Merge branch 'chore/copyright-headers' into 'develop'
[akkoma] / test / tasks / emoji_test.exs
index f2930652afbabbc0061d89757ed6d09d92256d35..0fb8603ac4b2890f67e995a9232b6cb5809b2167 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Mix.Tasks.Pleroma.EmojiTest do
   use ExUnit.Case, async: true
 
@@ -73,6 +77,19 @@ defmodule Mix.Tasks.Pleroma.EmojiTest do
       on_exit(fn -> File.rm_rf!("test/instance_static/emoji/finmoji") end)
     end
 
+    test "install local emoji pack" do
+      assert capture_io(fn ->
+               Emoji.run([
+                 "get-packs",
+                 "local",
+                 "--manifest",
+                 "test/instance_static/local_pack/manifest.json"
+               ])
+             end) =~ "Writing pack.json for"
+
+      on_exit(fn -> File.rm_rf!("test/instance_static/emoji/local") end)
+    end
+
     test "pack not found" do
       mock(fn
         %{
@@ -157,8 +174,8 @@ defmodule Mix.Tasks.Pleroma.EmojiTest do
       assert File.exists?(files_json)
 
       on_exit(fn ->
-        File.rm_rf!(pack_json)
-        File.rm_rf!(files_json)
+        File.rm!(pack_json)
+        File.rm!(files_json)
       end)
     end
 
@@ -218,8 +235,8 @@ defmodule Mix.Tasks.Pleroma.EmojiTest do
       assert captured =~ "#{pack_json} has been updated with the pack2 pack"
 
       on_exit(fn ->
-        File.rm_rf!(pack_json)
-        File.rm_rf!(files_json)
+        File.rm!(pack_json)
+        File.rm!(files_json)
       end)
     end
   end