| 1435 | } |
| 1436 | |
| 1437 | func TestIncludesOptionalExplicitFalse(t *testing.T) { |
| 1438 | t.Parallel() |
| 1439 | |
| 1440 | const dir = "testdata/includes_optional_explicit_false" |
| 1441 | wd, _ := os.Getwd() |
| 1442 | |
| 1443 | message := "task: No Taskfile found at \"%s/%s/TaskfileOptional.yml\"" |
| 1444 | expected := fmt.Sprintf(message, filepath.ToSlash(wd), dir) |
| 1445 | |
| 1446 | e := task.NewExecutor( |
| 1447 | task.WithDir(dir), |
| 1448 | task.WithStdout(io.Discard), |
| 1449 | task.WithStderr(io.Discard), |
| 1450 | ) |
| 1451 | |
| 1452 | err := e.Setup() |
| 1453 | require.Error(t, err) |
| 1454 | assert.Equal(t, expected, err.Error()) |
| 1455 | } |
| 1456 | |
| 1457 | func TestIncludesFromCustomTaskfile(t *testing.T) { |
| 1458 | t.Parallel() |