File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ defmodule Mix.ShellTest do
33
33
assert_received { :mix_shell , :yes? , [ "hello?" ] }
34
34
35
35
assert Mix . shell . cmd ( "echo first" ) == 0
36
-
36
+
37
37
nl = os_newline
38
38
assert_received { :mix_shell , :run , [ "first" <> ^ nl ] }
39
39
end
@@ -44,8 +44,13 @@ defmodule Mix.ShellTest do
44
44
assert capture_io ( fn -> Mix . shell . info "abc" end ) ==
45
45
"abc\n "
46
46
47
- assert capture_io ( :stderr , fn -> Mix . shell . error "def" end ) ==
48
- "#{ IO.ANSI . red } #{ IO.ANSI . bright } def#{ IO.ANSI . reset } \n "
47
+ if IO.ANSI . enabled? do
48
+ assert capture_io ( :stderr , fn -> Mix . shell . error "def" end ) ==
49
+ "#{ IO.ANSI . red } #{ IO.ANSI . bright } def#{ IO.ANSI . reset } \n "
50
+ else
51
+ assert capture_io ( :stderr , fn -> Mix . shell . error "def" end ) ==
52
+ "def\n "
53
+ end
49
54
50
55
assert capture_io ( "world" , fn -> assert Mix . shell . prompt ( "hello?" ) == "world" end ) ==
51
56
"hello? "
You can’t perform that action at this time.
0 commit comments