You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mix.raise"Project path must start with a letter and have only lowercase letters, numbers and underscore"
146
+
error="Application name must start with a letter and have only lowercase letters, numbers and underscore"
147
+
if!from_app_flag,do: error=error<>". The application name is inferred from the path, if you'd like to explicitly name the application then use the `--app APP` option."
error="Module name must start with a capital letter, have all periods immediately followed by a capital letter, and must contain only letters, numbers, and periods"
Copy file name to clipboardExpand all lines: lib/mix/test/mix/tasks/new_test.exs
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -110,11 +110,25 @@ defmodule Mix.Tasks.NewTest do
110
110
end
111
111
112
112
test"new with invalid args"do
113
-
in_tmp"new with invalid args",fn->
114
-
assert_raiseMix.Error,"Project path must start with a letter and have only lowercase letters, numbers and underscore",fn->
113
+
in_tmp"new with an invalid application name",fn->
114
+
assert_raiseMix.Error,"Application name must start with a letter and have only lowercase letters, numbers and underscore. The application name is inferred from the path, if you'd like to explicitly name the application then use the `--app APP` option.",fn->
115
115
Mix.Tasks.New.run["007invalid"]
116
116
end
117
+
end
118
+
119
+
in_tmp"new with an invalid application name from the app option",fn->
120
+
assert_raiseMix.Error,"Application name must start with a letter and have only lowercase letters, numbers and underscore",fn->
121
+
Mix.Tasks.New.run["valid","--app","007invalid"]
122
+
end
123
+
end
124
+
125
+
in_tmp"new with an invalid module name from the module options",fn->
126
+
assert_raiseMix.Error,"Module name must start with a capital letter, have all periods immediately followed by a capital letter, and must contain only letters, numbers, and periods",fn->
127
+
Mix.Tasks.New.run["valid","--module","not.valid"]
128
+
end
129
+
end
117
130
131
+
in_tmp"new without a specified path",fn->
118
132
assert_raiseMix.Error,"Expected PATH to be given, please use `mix new PATH`",fn->
0 commit comments