twolfson / doubleshot

Run separated BDD outlines and content on Mocha
MIT License
1 stars 0 forks source link

Allow for expansion and aliasing on global hooks #29

Closed twolfson closed 11 years ago

twolfson commented 11 years ago

Currently, due to a design flaw, we either have to hack with the global variable or break up object-fusion2 into a fuser module and an expansion/alias module.

The issue is that the global hooks need to handle expansion just like everyone else but nobody uses them as descriptions in their outlines (for obvious reasons). We could hackishly add the temporary description but it gets ugly fast when pulling that out.

The proper abstraction is to make the expansion of content something we can do without the fusing step.

Bonus features of this:

If we get it right, then in #13 we can call before as a method. crazy.

twolfson commented 11 years ago

We have failing tests on dev/implement.complex.global.hooks to resume later.

twolfson commented 11 years ago

When we break out the new module, I want to flatten all expanded hooks into one function and make all hooks into objects, so that renderBatch can be super-simple.

twolfson commented 11 years ago

Make sure that this new module uses flat files as its test suite.

twolfson commented 11 years ago

When this breakout happens, open an issue to nuke proxies from object-fusion2.

twolfson commented 11 years ago

The new module will take the content object and expand, alias, and flatten all values recursively.

twolfson commented 11 years ago

The new order for doubleshot:

  1. Expand/alias/flatten
  2. Collect each key into its own object and function
  3. Fuse
  4. Depth-first traversal, calling describe, before, it, etc.
  5. Disco.
twolfson commented 11 years ago

To re-iterate, the flattened function, will has the async.forEachSeries logic if it is an array. See renderBatch if you have forgotten what I am talking about.

twolfson commented 11 years ago

Module names

twolfson commented 11 years ago

Started this here https://github.com/twolfson/object-mapper

twolfson commented 11 years ago

Completed in 2.8.0.