logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

release_env_test.exs (715B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Mix.Tasks.Pleroma.ReleaseEnvTest do
  5. use ExUnit.Case
  6. import ExUnit.CaptureIO, only: [capture_io: 1]
  7. @path "config/pleroma.test.env"
  8. def do_clean do
  9. if File.exists?(@path) do
  10. File.rm_rf(@path)
  11. end
  12. end
  13. setup do
  14. do_clean()
  15. on_exit(fn -> do_clean() end)
  16. :ok
  17. end
  18. test "generate pleroma.env" do
  19. assert capture_io(fn ->
  20. Mix.Tasks.Pleroma.ReleaseEnv.run(["gen", "--path", @path, "--force"])
  21. end) =~ "The file generated"
  22. assert File.read!(@path) =~ "RELEASE_COOKIE="
  23. end
  24. end