Browse Source

Do config test a little bit differently

master
Sean King 4 months ago
parent
commit
c0c554d53b
Signed by: seanking GPG Key ID: 778810DE76B9460F
  1. 15
      test/mix/tasks/fuck_gab/config_test.exs

15
test/mix/tasks/fuck_gab/config_test.exs

@ -3,10 +3,11 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.FuckGab.ConfigTest do
use ExUnit.Case
use FuckGab.DataCase
@uuid Ecto.UUID.generate()
defp tmp_path do
"/tmp/generated_files/"
"/tmp/generated_files/#{@uuid}/"
end
setup do
@ -68,10 +69,12 @@ defmodule Mix.Tasks.FuckGab.ConfigTest do
tmp_path() <> "setup.psql"
])
assert_received {:mix_shell, :error,
[
"The task would have overwritten the following files:\n- /tmp/generated_files/generated_config.exs\n- /tmp/generated_files/setup.psql\nRerun with `--force` to overwrite them."
]}
assert_received {:mix_shell, :error, [message]}
assert message ==
"The task would have overwritten the following files:\n- #{tmp_path()}generated_config.exs\n- #{
tmp_path()
}setup.psql\nRerun with `--force` to overwrite them."
end
defp generated_setup_psql do

Loading…
Cancel
Save