33 Commits

Author SHA1 Message Date
Thibault Jouan
166dae681c Merge Recipe::DSL into Recipe 2014-09-22 19:43:30 +00:00
Thibault Jouan
e6ee3d5f77 Implement `-t' CLI option switch to specify target 2014-06-27 17:32:42 +00:00
Thibault Jouan
3c46c5bc61 Implement `test_macro' recipe keyword 2014-06-03 16:27:59 +00:00
Thibault Jouan
48a9da9365 Fix coding standards (module nesting) in specs 2014-02-08 17:59:33 +00:00
Thibault Jouan
f92ad8128d Implement set' and get' recipe keywords:
`set' registers a value at given index in env registry, `get'
retrieves a value at given index.
2014-01-21 17:11:17 +00:00
Thibault Jouan
161c784cbe Make Recipe::DSL methods public 2014-01-20 01:47:19 +00:00
Thibault Jouan
42a82c9c80 Add Recipe::DSL#{code,block} attribute readers 2014-01-20 01:47:19 +00:00
Thibault Jouan
2d9c84d04e Refactor Recipe::DSL spec with described_class 2014-01-20 01:47:19 +00:00
Thibault Jouan
56ea377e31 Fix coding standards (empty blocks) 2014-01-08 22:16:51 +00:00
Thibault Jouan
9971283841 Improve Recipe::DSL#initialize spec 2014-01-08 22:14:16 +00:00
Thibault Jouan
352fcd37f8 Modify recipe DSL API to take env on initialization 2014-01-08 22:13:14 +00:00
Thibault Jouan
e8be44d1f0 Implement `macro' recipe keyword 2013-12-20 23:19:16 +00:00
Thibault Jouan
366c682152 Remove Recipe::DSL.evaluate method 2013-12-20 11:24:30 +00:00
Thibault Jouan
ef0307fbb5 Improve small details in specs:
* Fix coding standards;
* Simplify some expectations (eq instead of be matcher);
* Expect identity on block instead of calling;
* Change some before call as oneliners;
* Avoid shadowing variable names;
* Improve wording where needed.
2013-12-19 22:46:56 +00:00
Thibault Jouan
0307d6020a Remove uneeded once() calls from spec 2013-09-22 22:38:13 +00:00
Thibault Jouan
782c8f8498 Fix coding standards in specs (parenthesis usage) 2013-08-22 00:23:07 +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
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
a5d9ca26f4 Remove error handling for evaluation errors 2013-08-13 00:42:14 +00:00
Thibault Jouan
3ef533b67a Move Recipe::DSL#tasks example in spec file 2013-08-07 01:07:13 +00:00
Thibault Jouan
29563f6cc6 Add missing spec for Recipe::DSL#task 2013-08-06 20:31:14 +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
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
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
Thibault Jouan
57ff1c73be Change "wording" in Recipe::DSL#evaluate spec 2013-08-01 17:18:15 +00:00
Thibault Jouan
a45a340b64 Improve some context descriptions in specs 2013-08-01 00:01:20 +00:00
Thibault Jouan
3792f60a5c Improve source recipe keyword feature:
* Improve error reporting from sourced recipe;
* Extract cucumber feature from recipe one.
2013-08-01 00:01:19 +00:00
Thibault Jouan
2939123574 Extract recipe DSL code and spec 2013-08-01 00:01:19 +00:00