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
3333 assert_received { :mix_shell , :yes? , [ "hello?" ] }
3434
3535 assert Mix . shell . cmd ( "echo first" ) == 0
36-
36+
3737 nl = os_newline
3838 assert_received { :mix_shell , :run , [ "first" <> ^ nl ] }
3939 end
@@ -44,8 +44,13 @@ defmodule Mix.ShellTest do
4444 assert capture_io ( fn -> Mix . shell . info "abc" end ) ==
4545 "abc\n "
4646
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
4954
5055 assert capture_io ( "world" , fn -> assert Mix . shell . prompt ( "hello?" ) == "world" end ) ==
5156 "hello? "
You can’t perform that action at this time.
0 commit comments