iammerrick/Squire.js — pull request #42 by adjohnson916 (2013-12-23 04:26:45+00:00)
Title: Add ability to modify and extend dependencies

This extrapolates on the idea of mocks, so that mocking complicated dependencies is far less painful.

I added a `modify` method that will load actual dependencies via require then applying modifier functions to manipulate those dependencies before injecting them into dependent modules. Before, I was doing this manually, but wasn't able to my modifications from polluting the global require context. These new methods will limit changes to the require context of each `Squire` instance.

I have also added a convenient `extend` method which applies a simple modifier to do a shallow extend/override of properties on the dependency object.