90 Commits

Author SHA1 Message Date
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
Thibault Jouan
8e455fc4d5 Improve Env constructor 2013-08-04 15:45:08 +00:00
Thibault Jouan
a3bba6d4da Implement target recipe keyword feature 2013-08-03 23:42:47 +00:00
Thibault Jouan
a6e27edfd2 Add env recipe keyword feature 2013-08-03 23:42:41 +00:00
Thibault Jouan
d677c3aa97 Improve exceptions usage in specs:
* Throw symbols instead of raising exceptions to test code evaluation,
  this will reduce "bad" usages of exceptions, symbols seems a little
  better for now;
* Add a specific exception to be used in specs for testing behaviour
  when an exception is raised from a recipe.
2013-08-01 23:23:49 +00:00
Thibault Jouan
c3737e738e Refactor trap_exit spec helper usages 2013-08-01 22:51:41 +00:00
Thibault Jouan
c4fc9828db Improve error reporting during recipe evaluation
* Report invalid action usages from tasks;
* Implement backtrace cleaning in CLI;
* Extract error class declarations in a new errors file;
* Replace raise with fail keyword in task DSL class.
2013-08-01 20:31:39 +00:00
Thibault Jouan
836f9ffc29 Replaces Proc.new usages with proc keyword 2013-08-01 18:33:18 +00:00