nathanmacinnes/injectr — Issue #7: Should allow context variable injection
Author: nathanmacinnes
Created: 2012-02-02 13:28:15+00:00
State: open

I want to be able to inject objects into the current context. Implementation would be pretty straightforward; it's the interface which is difficult. The interface I've got in my head at the moment is something like this:

````javascript
injectr(file, {
deps : {
fs : mockFs
},
context : {
varName : obj
}
});
````
This would of course be an alternative to the existing interface, so **injectr** would need to check if the object has `deps` and `context` properties, and if it does, go with this structure.

This would allow **injectr** to become more than just a dependency injector for testing.