We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc0688 commit 54ffb57Copy full SHA for 54ffb57
lib/mix/test/mix/shell/io_test.exs
@@ -28,4 +28,19 @@ defmodule Mix.Shell.IOTest do
28
assert capture_io("n", fn -> refute yes?("Ok?") end)
29
assert capture_io("", fn -> refute yes?("Ok?") end)
30
end
31
+
32
+ test "runs a given command" do
33
+ assert capture_io("", fn -> assert cmd("echo hello") == 0 end) == "hello\n"
34
35
+ will_print_sample()
36
+ assert capture_io("", fn -> assert cmd("echo hello", print_app: false) == 0 end) ==
37
+ "hello\n"
38
+ assert capture_io("", fn -> assert cmd("echo hello") == 0 end) ==
39
+ "==> sample\nhello\n"
40
+ end
41
42
+ defp will_print_sample do
43
+ Mix.Project.push nil
44
+ Mix.Project.push MixTest.Case.Sample
45
46
0 commit comments