Implement basic condition DSL framework for tests:
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.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
Feature: `condition' task keyword
|
||||
|
||||
Scenario: prevents task evaluation when condition is not met
|
||||
Scenario: prevents task actions application when condition is not met
|
||||
Given a recipe with:
|
||||
"""
|
||||
task :hello do
|
||||
condition { false }
|
||||
|
||||
puts 'evaluated'
|
||||
exit 70
|
||||
echo 'evaluated'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
|
Reference in New Issue
Block a user