@@ -36,7 +36,6 @@ defmodule Kernel.CLITest do
36
36
use ExUnit.Case , async: true
37
37
38
38
import ExUnit.CaptureIO
39
- import Retry
40
39
41
40
defp run ( argv ) do
42
41
{ config , argv } = Kernel.CLI . parse_argv ( Enum . map ( argv , & String . to_charlist / 1 ) )
@@ -60,6 +59,12 @@ defmodule Kernel.CLITest do
60
59
[ "sample.exs" , "-o" , "1" , "2" ]
61
60
end )
62
61
end
62
+ end
63
+
64
+ defmodule Kernel.CLI.ExecutableTest do
65
+ use ExUnit.Case , async: true
66
+
67
+ import Retry
63
68
64
69
@ tag :tmp_dir
65
70
test "file smoke test" , context do
@@ -130,7 +135,7 @@ defmodule Kernel.CLITest do
130
135
assert output =~ "--short-version : Standalone options can't be combined with other options"
131
136
end
132
137
133
- test "properly parses paths" do
138
+ test "parses paths" do
134
139
root = fixture_path ( "../../.." ) |> to_charlist
135
140
136
141
args =
@@ -148,7 +153,7 @@ defmodule Kernel.CLITest do
148
153
assert to_charlist ( Path . expand ( ~c" lib/list" , root ) ) in path
149
154
end
150
155
151
- stderr_test "properly formats errors" do
156
+ stderr_test "formats errors" do
152
157
assert String . starts_with? ( elixir ( ~c" -e \" :erlang.throw 1\" " ) , "** (throw) 1" )
153
158
154
159
assert String . starts_with? (
@@ -173,6 +178,11 @@ defmodule Kernel.CLITest do
173
178
assert error =~ "def fetch(-%module{} = container-, +key+)"
174
179
assert error =~ ~r" \( elixir #{ System . version ( ) } \) lib/access\. ex:\d +: Access\. fetch/2"
175
180
end
181
+
182
+ test "invokes at_exit callbacks" do
183
+ assert elixir ( fixture_path ( "at_exit.exs" ) |> to_charlist ( ) ) ==
184
+ "goodbye cruel world with status 1\n "
185
+ end
176
186
end
177
187
178
188
defmodule Kernel.CLI.RPCTest do
@@ -227,15 +237,6 @@ defmodule Kernel.CLI.RPCTest do
227
237
end
228
238
end
229
239
230
- defmodule Kernel.CLI.AtExitTest do
231
- use ExUnit.Case , async: true
232
-
233
- test "invokes at_exit callbacks" do
234
- assert elixir ( fixture_path ( "at_exit.exs" ) |> to_charlist ) ==
235
- "goodbye cruel world with status 1\n "
236
- end
237
- end
238
-
239
240
defmodule Kernel.CLI.CompileTest do
240
241
use ExUnit.Case , async: true
241
242
0 commit comments