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:
Thibault Jouan
2013-08-08 01:52:48 +00:00
parent 0008f0255a
commit 639bdc1c73
12 changed files with 237 additions and 41 deletions

View File

@@ -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