-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup test system Mix.env/0 check (#135)
- Loading branch information
1 parent
265f188
commit 67e626d
Showing
9 changed files
with
60 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule Expublish.Shell do | ||
@moduledoc false | ||
|
||
def cmd(command, opts \\ []) do | ||
adapter().cmd(command, opts) | ||
end | ||
|
||
defp adapter do | ||
Application.get_env(:expublish, :shell_adapter, Mix.Shell.IO) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
defmodule Expublish.System do | ||
@moduledoc false | ||
def cmd(command, args, opts \\ []) do | ||
adapter().cmd(command, args, opts) | ||
end | ||
|
||
defp adapter do | ||
Application.get_env(:expublish, :system_adapter, System) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Expublish.TestShell do | ||
@moduledoc false | ||
|
||
require Logger | ||
|
||
def cmd(command, args \\ []) do | ||
args_string = Enum.join(args, " ") | ||
|
||
"#{command} #{args_string}" | ||
|> String.trim() | ||
|> Logger.info() | ||
|
||
0 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
ExUnit.start() | ||
|
||
Application.put_env(:expublish, :system_adapter, Expublish.TestSystem) | ||
Application.put_env(:expublish, :shell_adapter, Expublish.TestShell) |