When a user is configured for the targeted host name, use it for SSH
authentification instead of the name of current user logged in.
* Modify Remote#user_name to use configured user name.
This class is included in net-ssh, but net-sftp adds some new methods
that we need for our tests. This code resides in net-sftp test helper,
and can't be required dynamicaly, this change adds a copy of the code we
need, hardcoded in NetSSHStoryHelpers.
Represent a registry for remote environment variables, will follow an
API similar to Hash except the constructor. Currently only #has_key? is
implemented.
In Condition:
* Modify constructor to accepts tests and a default return value;
* Implement #met?;
* Modify #! so that it return the negated value returned by #met?.
In Condition::DSL:
* Modify .evaluate to build the condition with tests and the value
returned by a the evaluated condition block.
Add a basic Test base class, with env and arguments as attributes.
Add some spec helpers to build some easily testable kind of Test
instances (as test doubles).
Use instance_eval so that the assigned block is evaluated inside the
DSL sandbox instance, giving access to all required methods and instance
variables.
Add the necessary API so that we can implement new tests easily as new
standalone classes.
In Condition::DSL:
* Add #tests accessor;
* Modify constructor so that it accepts the env;
* Implement .define_test(keyword, class) method.
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.
Remove most of task evaluation code from Task class, rely on
Task::DSL.evaluate to get an evaluated task.
* Task: remove #evaluate, change constructor prototype to accept actions
instead of a block, implement .evaluate(name, env &block);
* Implement Task::DSL.evaluate method;
* Recipe::DSL: remove tasks evaluation from#evaluate, modify #task to
use Task.evaluate to return the new task to be rigstered.