Skip to content

Commit 8dabe63

Browse files
committed
Reorganize testing structure
1 parent b665ddd commit 8dabe63

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

lib/elixir/test/elixir/kernel/cli_test.exs

+13-12
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ defmodule Kernel.CLITest do
3636
use ExUnit.Case, async: true
3737

3838
import ExUnit.CaptureIO
39-
import Retry
4039

4140
defp run(argv) do
4241
{config, argv} = Kernel.CLI.parse_argv(Enum.map(argv, &String.to_charlist/1))
@@ -60,6 +59,12 @@ defmodule Kernel.CLITest do
6059
["sample.exs", "-o", "1", "2"]
6160
end)
6261
end
62+
end
63+
64+
defmodule Kernel.CLI.ExecutableTest do
65+
use ExUnit.Case, async: true
66+
67+
import Retry
6368

6469
@tag :tmp_dir
6570
test "file smoke test", context do
@@ -130,7 +135,7 @@ defmodule Kernel.CLITest do
130135
assert output =~ "--short-version : Standalone options can't be combined with other options"
131136
end
132137

133-
test "properly parses paths" do
138+
test "parses paths" do
134139
root = fixture_path("../../..") |> to_charlist
135140

136141
args =
@@ -148,7 +153,7 @@ defmodule Kernel.CLITest do
148153
assert to_charlist(Path.expand(~c"lib/list", root)) in path
149154
end
150155

151-
stderr_test "properly formats errors" do
156+
stderr_test "formats errors" do
152157
assert String.starts_with?(elixir(~c"-e \":erlang.throw 1\""), "** (throw) 1")
153158

154159
assert String.starts_with?(
@@ -173,6 +178,11 @@ defmodule Kernel.CLITest do
173178
assert error =~ "def fetch(-%module{} = container-, +key+)"
174179
assert error =~ ~r"\(elixir #{System.version()}\) lib/access\.ex:\d+: Access\.fetch/2"
175180
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
176186
end
177187

178188
defmodule Kernel.CLI.RPCTest do
@@ -227,15 +237,6 @@ defmodule Kernel.CLI.RPCTest do
227237
end
228238
end
229239

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-
239240
defmodule Kernel.CLI.CompileTest do
240241
use ExUnit.Case, async: true
241242

0 commit comments

Comments
 (0)