File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ defmodule ElixirScript.ScriptRunnerBehaviour do
2
+ @ callback run ( script :: String . t ( ) , opts :: Keyword . t ( ) ) :: any ( )
3
+ end
4
+
1
5
defmodule ElixirScript.ScriptRunner do
2
6
@ moduledoc """
3
7
Executes dynamic Elixir script content, allowing for the execution of arbitrary code snippets.
4
8
"""
9
+ @ behaviour ElixirScript.ScriptRunnerBehaviour
10
+
5
11
alias ElixirScript.Context
6
12
13
+ @ impl ElixirScript.ScriptRunnerBehaviour
7
14
def run ( script , opts \\ [ ] ) do
8
15
token = Keyword . get ( opts , :github_token )
9
16
Original file line number Diff line number Diff line change 1
1
Mox . defmock ( SystemEnvMock , for: ElixirScript.Behaviours.SystemEnvBehaviour )
2
2
Application . put_env ( :context , :system_env , SystemEnvMock )
3
3
4
+ # # #
5
+
4
6
Mox . defmock ( TentacatMock.ClientMock ,
5
7
for: ElixirScript.Behaviours.TentacatBehaviour.ClientBehaviour
6
8
)
7
9
8
10
Application . put_env ( :script_runner , :tentacat_client , TentacatMock.ClientMock )
9
11
12
+ # # #
13
+
14
+ Mox . defmock ( ElixirScript.ScriptRunnerMock , for: ElixirScript.ScriptRunnerBehaviour )
15
+ Application . put_env ( :command_line , :script_runner , ElixirScript.ScriptRunnerMock )
16
+
17
+ # # #
18
+
10
19
ExUnit . start ( )
You can’t perform that action at this time.
0 commit comments