mirror of
https://github.com/go-task/task.git
synced 2025-06-15 00:15:10 +02:00
refactor: unify how executor tests are written (#2042)
* feat: use TaskTest for executor tests * feat: more tests * feat: separate tests for executing and formatting with new functional options that work for both test types * feat: formatter tests * refactor: more tests
This commit is contained in:
@ -217,6 +217,14 @@ func ExecutorWithAssumeYes(assumeYes bool) ExecutorOption {
|
||||
}
|
||||
|
||||
// WithAssumeTerm is used for testing purposes to simulate a terminal.
|
||||
func ExecutorWithAssumeTerm(assumeTerm bool) ExecutorOption {
|
||||
return func(e *Executor) {
|
||||
e.AssumeTerm = assumeTerm
|
||||
}
|
||||
}
|
||||
|
||||
// ExecutorWithDry tells the [Executor] to output the commands that would be run
|
||||
// without actually running them.
|
||||
func ExecutorWithDry(dry bool) ExecutorOption {
|
||||
return func(e *Executor) {
|
||||
e.Dry = dry
|
||||
|
Reference in New Issue
Block a user