forked from elixirscript/elixirscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli_test.exs
More file actions
33 lines (28 loc) · 830 Bytes
/
cli_test.exs
File metadata and controls
33 lines (28 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
defmodule ElixirScript.CLI.Test do
use ExUnit.Case
import ExUnit.CaptureIO
test "parse_args" do
{_, args} = ElixirScript.CLI.parse_args(["Atom", "--format", "umd"])
assert args == [format: "umd"]
end
test "process help" do
assert capture_io(fn ->
ElixirScript.CLI.process(:help)
end) =~ "usage: elixirscript <module> [options]"
end
test "process version" do
assert capture_io(fn ->
ElixirScript.CLI.process(:version)
end) =~ Mix.Project.config()[:version]
end
test "process unknown" do
assert capture_io(fn ->
ElixirScript.CLI.process({"", [unknown: ""]})
end) =~ "usage: elixirscript <module> [options]"
end
test "process input" do
assert capture_io(fn ->
ElixirScript.CLI.process({["Atom"], []})
end) =~ "export default Elixir"
end
end