Skip to content

Instantly share code, notes, and snippets.

@baweaver
Last active January 3, 2016 13:09
Show Gist options
  • Save baweaver/8467481 to your computer and use it in GitHub Desktop.
Save baweaver/8467481 to your computer and use it in GitHub Desktop.
A working draft for Skyforge, a super powered mocking framework.
# Skyforge
Forge mock objects for your test with immense power! This one is currently in development,
and not close to being done. So what are we planning to do here?
## !!! THIS IS THEORETICAL, UNDER CONSTRUCTION !!!
## Trace
Using Mockingjay, trace a ruby hash to make a generator for more objects like it.
## Mold
Use a tracing or hash passed to Valor to make Virtus generators. Suggested to cache
these to a folder so they don't need to be regenerated repeatedly. This should only
need to be a one time for every new model added to generation.
## Forge
Forge a series of test objects using their molds and traces, and creates new Virtus
objects to use.
## Mastery
Hooks all Molds used with method_profiler to find out how much of the data instantiated
is actually used.
Makes suggestions, and will offer to generate new light models for the specs. Attempts
to make spec model and fixture creation as efficent as possible.
Takes data from method_profiler reports to generate new lighter mockingjay traces, saves
to folder to create new generators for tests which warrant it (ie 20%+ data not being
used.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment