Instead of interrupting task evaluation when condition is not met, allow the whole task to be evaluated (including condition and evaluation) so that the interpreter will get all tasks actions (whether condition is met or not) and be able to query the condition. * Modify Interpreter#process_task: test if task condition is met before applying the actions; * Implement condition handling in Task and Task::DSL; * Implement Condition and Condition::DSL (useless as they are, but needed to implement later test keywords as part of the condition DSL.
15 lines
350 B
Gherkin
15 lines
350 B
Gherkin
Feature: `condition' task keyword
|
|
|
|
Scenario: prevents task actions application when condition is not met
|
|
Given a recipe with:
|
|
"""
|
|
task :hello do
|
|
condition { false }
|
|
|
|
echo 'evaluated'
|
|
end
|
|
"""
|
|
When I execute the recipe
|
|
Then the exit status must be 0
|
|
And the output must not contain "evaluated"
|