Thibault Jouan
5e6f5f4861
Remove deprecated rspec option
2013-12-19 19:47:29 +00:00
Thibault Jouan
a692efe96d
Replace be_true' matchers with be true' in specs
2013-12-19 19:46:32 +00:00
Thibault Jouan
3b3542fc66
Fix an example in Task::DSL.evaluate specs
2013-12-19 19:45:37 +00:00
Thibault Jouan
217b8a203a
Add missing empty line in test spec
2013-10-01 19:38:17 +00:00
Thibault Jouan
a36b30dd3c
Bump version to 0.1.4
2013-10-01 19:38:09 +00:00
Thibault Jouan
85a47df547
Use SSH user name configured for a given target:
...
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.
2013-09-28 20:07:36 +00:00
Thibault Jouan
768a6755de
Implement Remote#config:
...
Load SSH configuration for targeted host name.
2013-09-26 19:22:07 +00:00
Thibault Jouan
9985fceb63
Extract logic for current target ssh user name:
...
Add Remote#user_name method, with code returning which user name
will be used for SSH authentication.
2013-09-26 18:34:19 +00:00
Thibault Jouan
868c502531
Remove multibyte char from Remote::FS spec
2013-09-26 01:00:06 +00:00
Thibault Jouan
c281687bfb
Bump version to 0.1.3
2013-09-26 00:30:41 +00:00
Thibault Jouan
2cbe1726f7
Implement `has_file' condition keyword
2013-09-26 00:28:40 +00:00
Thibault Jouan
3492382968
Implement Remote::FS#has_file?
2013-09-26 00:28:40 +00:00
Thibault Jouan
91f2bc3567
Implement Remote#fs
2013-09-26 00:28:40 +00:00
Thibault Jouan
99710b0df9
Implement Remote::FS#sftp
2013-09-26 00:28:40 +00:00
Thibault Jouan
d240df0281
Add Remote::FS class
2013-09-26 00:28:40 +00:00
Thibault Jouan
8531c49e6d
Implement NetSSHStoryHelpers#sftp_story
2013-09-26 00:28:39 +00:00
Thibault Jouan
0529fab3c2
Import Net::SSH::Test::Channel code from net-sftp:
...
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.
2013-09-26 00:28:39 +00:00
Thibault Jouan
b2dbd60830
Add net-sftp gem dependency
2013-09-26 00:28:39 +00:00
Thibault Jouan
c01e143c86
Enable sftp subsystem in cucumber sshd config
2013-09-26 00:28:39 +00:00
Thibault Jouan
e51adbdefa
Bump version to 0.1.2
2013-09-26 00:20:39 +00:00
Thibault Jouan
9040420360
Improve net-ssh mock connection usage in specs
2013-09-24 21:08:01 +00:00
Thibault Jouan
e676eb40d6
Transform Tests class in a module
2013-09-23 21:44:50 +00:00
Thibault Jouan
0307d6020a
Remove uneeded once() calls from spec
2013-09-22 22:38:13 +00:00
Thibault Jouan
36cf2e041f
Improve wording in sh cucumber feature
2013-09-07 21:40:59 +00:00
Thibault Jouan
85109afd46
Fix missing Then keywords in cucumber features
2013-09-07 21:40:25 +00:00
Thibault Jouan
33a2b9de5a
Refactor producer invocation in cucumber features:
...
Use "When I successfully execute" instead of "When I execute", and
assert that exit status code was successful in this new step.
2013-09-06 20:10:28 +00:00
Thibault Jouan
0a9f7e38af
Simplify Task::DSL.evaluate spec
2013-08-22 10:45:12 +00:00
Thibault Jouan
782c8f8498
Fix coding standards in specs (parenthesis usage)
2013-08-22 00:23:07 +00:00
Thibault Jouan
a555df40c6
Refactor interpreter spec
2013-08-22 00:22:16 +00:00
Thibault Jouan
856e78245f
Remove extra empty line in echo action spec
2013-08-22 00:21:43 +00:00
Thibault Jouan
7a1c01a299
Remove empty cucumber support file
2013-08-22 00:11:09 +00:00
Thibault Jouan
8247f3a973
Bump version to 0.1.1
2013-08-20 03:53:38 +00:00
Thibault Jouan
f42fd856ff
Fix missing gem description
2013-08-20 03:53:22 +00:00
Thibault Jouan
5d3173977f
Bump version to 0.1.0
2013-08-20 03:16:45 +00:00
Thibault Jouan
04afc82a29
Implement `has_env' condition keyword
2013-08-20 03:03:17 +00:00
Thibault Jouan
b0ea7d876e
Implement Remote#environment:
...
Build and return a Remote::Environment instance, with the output of
`env` command execution.
2013-08-20 03:03:07 +00:00
Thibault Jouan
513ba4eedb
Implement basic Remote::Environment class:
...
Represent a registry for remote environment variables, will follow an
API similar to Hash except the constructor. Currently only #has_key? is
implemented.
2013-08-20 02:13:54 +00:00
Thibault Jouan
ed99c191e0
Build conditions with DSL evaluated tests:
...
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).
2013-08-18 00:29:36 +00:00
Thibault Jouan
00a11e159f
Use instance_eval in Condition::DSL#evaluate:
...
Use instance_eval so that the assigned block is evaluated inside the
DSL sandbox instance, giving access to all required methods and instance
variables.
2013-08-18 00:29:36 +00:00
Thibault Jouan
3a0ce82799
Improve Condition DSL framework:
...
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.
2013-08-18 00:29:36 +00:00
Thibault Jouan
639bdc1c73
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.
2013-08-18 00:29:14 +00:00
Thibault Jouan
0008f0255a
Fix confusing local variable name in Task spec
2013-08-17 00:45:09 +00:00
Thibault Jouan
b4e6fa3ef6
Fix sort order of main internal requires
2013-08-17 00:44:28 +00:00
Thibault Jouan
b6adc0ba43
Fix wording in Task#initialize spec
2013-08-16 21:08:33 +00:00
Thibault Jouan
e4a4211a7b
Rename Worker class as Interpreter
2013-08-16 19:30:51 +00:00
Thibault Jouan
5a4c8c02bc
Fix coding standards in Task class
2013-08-15 22:35:10 +00:00
Thibault Jouan
a028b8922f
Increase Task.evaluate spec coverage
2013-08-15 22:34:13 +00:00
Thibault Jouan
d4d5222261
Refactor task DSL usages:
...
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.
2013-08-15 22:28:16 +00:00
Thibault Jouan
000c21e094
Remove uneeded call in Recipe::DSL#env spec
2013-08-15 22:28:11 +00:00
Thibault Jouan
a675c9c910
Implement `echo' task action
2013-08-14 23:43:36 +00:00
Thibault Jouan
f0e144cebd
Refactor and simplify recipe DSL evaluation usages:
...
Remove most of recipe evaluation code in Recipe class, and rely on
Recipe::DSL to get evaluated recipes.
* Remove Recipe#evaluate call from CLI, rely on
Recipe.evaluate_from_file to get the evaluated recipe;
* Implement Recipe.evaluate_from_file(filepath, env);
* Implement Recipe::DSL.evaluate(code, env);
* Remove code and filepath accessor on Recipe;
* Remove Recipe.from_file and Recipe#evaluate methods;
* Move task evaluations in Recipe::DSL#evaluate;
* Modify Recipe constructor so that it accepts tasks as argument.
2013-08-14 19:48:43 +00:00
Thibault Jouan
7c5d5b0417
Improve Recipe::DSL#initialize spec
...
Fix current examples by testing assignations, and add missing example
about @tasks assignation.
2013-08-13 22:47:23 +00:00
Thibault Jouan
53db841b2d
Remove Env#current_recipe attribute
2013-08-13 01:36:33 +00:00
Thibault Jouan
a5d9ca26f4
Remove error handling for evaluation errors
2013-08-13 00:42:14 +00:00
Thibault Jouan
0904fa1fc9
Implement Worker class:
...
* Move recipe processing code in the worker;
* Refactor CLI and use the the worker;
* Implement Recipe#tasks and remove tasks application during evaluation,
tasks are now applied by the worker after all evaluations are done.
2013-08-10 14:47:02 +00:00
Thibault Jouan
ec44d01c36
Fix coding standards in shell command action spec
2013-08-10 14:46:31 +00:00
Thibault Jouan
8af6d0ec00
Add basic Rakefile (required by various CI platforms)
2013-08-08 18:07:06 +00:00
Thibault Jouan
71024dfb74
Add license file
2013-08-08 02:00:15 +00:00
Thibault Jouan
825bdec74d
Improve `sh' task action error handling:
...
Handle exit status code in Remote#execute.
2013-08-07 23:39:49 +00:00
Thibault Jouan
f10914c7d7
Implement basic `sh' task action feature:
...
* Executes a command on the remote host;
* Forwards remote standard output.
2013-08-07 16:16:40 +00:00
Thibault Jouan
8123cf5052
Add Task#initialize spec
2013-08-07 01:22:46 +00:00
Thibault Jouan
dff95b2c4b
Fix coding standards in Env spec
2013-08-07 01:22:12 +00:00
Thibault Jouan
b8fd24973a
Improve Task::DSL spec:
...
* Improve #initialize spec wording and expectation;
* Add #actions spec.
2013-08-07 01:16:00 +00:00
Thibault Jouan
0148854843
Make DSL specific method private in Task#DSL
2013-08-07 01:14:44 +00:00
Thibault Jouan
3ef533b67a
Move Recipe::DSL#tasks example in spec file
2013-08-07 01:07:13 +00:00
Thibault Jouan
ef96a2db82
Improve naming in Remote#execute spec
2013-08-06 20:45:42 +00:00
Thibault Jouan
22ae12185d
Improve Recipe spec:
...
* Fix coding standards;
* Add spec for default assigned filepath;
* Add spec for #filepath accessor;
* Test object identity in #code spec.
2013-08-06 20:39:17 +00:00
Thibault Jouan
29563f6cc6
Add missing spec for Recipe::DSL#task
2013-08-06 20:31:14 +00:00
Thibault Jouan
d552c698de
Improve Env#output spec:
...
Test the receiving output object state instead of expecting that it
will receive a specific message.
2013-08-06 20:12:02 +00:00
Thibault Jouan
31b9e68026
Improve Env#initialize spec:
...
Test that #current_recipe returns exactly the assigned recipe
(argument given to the constructor).
2013-08-06 20:07:39 +00:00
Thibault Jouan
863155b61d
Improve wording in Env#initialize spec
2013-08-06 20:06:05 +00:00
Thibault Jouan
883d4f2e7e
Fix coding standards in remote spec
2013-08-06 20:02:27 +00:00
Thibault Jouan
9285a951c7
Add missing spec for CLI#initialize
2013-08-06 20:02:23 +00:00
Thibault Jouan
779eb72c32
Improve wording in CLI#arguments spec
2013-08-06 19:41:48 +00:00
Thibault Jouan
bd1bdba9cf
Fix CLI#evaluate_recipe_file spec:
...
The spec wasn't covering the case when recipe evaluation raises an
unexpected error.
2013-08-06 19:38:33 +00:00
Thibault Jouan
eaccf55581
Improve CLI spec:
...
Test #arguments accessor instead of testing the constructor.
2013-08-06 19:17:22 +00:00
Thibault Jouan
889ddf84e4
Fix Action#env spec:
...
Test that we get the exact assigned object, instead of just testing
equality.
2013-08-06 19:11:29 +00:00
Thibault Jouan
3c92b04b90
Rename task evaluation feature file
2013-08-06 19:05:43 +00:00
Thibault Jouan
6f563d75d7
Improve a test in task evaluation feature
2013-08-06 19:05:01 +00:00
Thibault Jouan
72d6a853ae
Improve wording in task evaluation feature
2013-08-06 19:04:49 +00:00
Thibault Jouan
d5cbff9c4d
Improve wording in `condition' task keyword feature
2013-08-06 19:02:35 +00:00
Thibault Jouan
786c2f56d6
Improve wording in `target' recipe keyword
2013-08-06 19:00:57 +00:00
Thibault Jouan
cd13cebfd8
Refactor `source' recipe keyword feature
2013-08-06 19:00:14 +00:00
Thibault Jouan
bc0ea65316
Improve wording in `source' recipe keyword feature
2013-08-06 18:55:24 +00:00
Thibault Jouan
64a57c7cfd
Improve test in recipe evaluation output feature
2013-08-06 18:55:00 +00:00
Thibault Jouan
98b141136b
Improve wording in `env' recipe keyword feature
2013-08-06 18:49:57 +00:00
Thibault Jouan
5c11487601
Fix indentation in CLI usage feature
2013-08-06 18:49:35 +00:00
Thibault Jouan
8069e1ceaf
Improve features directory tree
2013-08-06 18:48:52 +00:00
Thibault Jouan
580ad66bab
Use new rspec metadata arguments as symbol
2013-08-06 18:34:53 +00:00
Thibault Jouan
cff122432b
Refactor Net::SSH spec helpers definition and usages
2013-08-06 17:29:45 +00:00
Thibault Jouan
5d9a5f1f57
Simplify spec helper:
...
Move specific exception `SomeErrorInRecipe' in the only spec where it
is used.
2013-08-06 17:13:41 +00:00
Thibault Jouan
d7d7d42223
Implement @sshd cucumber tag hooks:
...
Fork an sshd server available for the duration of the scenario.
$HOME will be set to aruba temporary directory, and a custom ssh
config will be written so that the test server is accessible with the
alias `some_host.test'. sshd will listen on port 2222 by default, this
can be overridden by setting DEFAULT_LISTEN_PORT environment variable to
the desired port.
2013-08-05 20:08:11 +00:00
Thibault Jouan
9875a4ae7b
Make remote available to env
2013-08-05 20:05:58 +00:00
Thibault Jouan
ace5bfb3fa
Add basic Remote#execute implementation
2013-08-05 20:03:13 +00:00
Thibault Jouan
6e1ba269eb
Implement Remote class
2013-08-05 19:58:17 +00:00
Thibault Jouan
3e3547d3be
Fix incorrect paths for env and target features
2013-08-05 19:54:32 +00:00
Thibault Jouan
ad63164d60
Fix coding standards in Env spec
2013-08-05 14:32:23 +00:00
Thibault Jouan
47560e55c5
Extract cucumber and aruba monkey patches
2013-08-05 14:15:23 +00:00
Thibault Jouan
0cccbc8dde
Add Env#output with $stdout as default
2013-08-04 21:29:13 +00:00
Thibault Jouan
e6c14f1903
Implement basic task actions API:
...
* Add Action base class;
* Implement Task::DSL.define_action(keyword, klass);
* Add Task::DSL#actions accessor;
* Apply task DSL actions when Task instances are evaluated.
2013-08-04 20:30:54 +00:00