1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

Added version validation and updated tests

This commit is contained in:
Evgeny Abramovich
2020-02-15 17:24:06 +03:00
parent f38ba7fcd3
commit 17ad7060b3
6 changed files with 48 additions and 5 deletions

View File

@@ -551,6 +551,21 @@ func TestIncludes(t *testing.T) {
tt.Run(t)
}
func TestIncorrectVersionIncludes(t *testing.T) {
const dir = "testdata/incorrect_includes"
expectedError := "task: Import with additional parameters is only available starting on Taskfile version v3"
var buff bytes.Buffer
e := task.Executor{
Dir: dir,
Stdout: &buff,
Stderr: &buff,
Silent: true,
}
assert.EqualError(t, e.Setup(), expectedError)
}
func TestIncludesEmptyMain(t *testing.T) {
tt := fileContentTest{
Dir: "testdata/includes_empty",