var rewire = require('rewire');
var path = require('canonical-path');
var Q = require('q');
var processorFactory = rewire('../../processors/debugDumpProcessor');

var writeFileSpy = jasmine.createSpy('writeFile').and.returnValue(Q());
processorFactory.__set__('writeFile', writeFileSpy);

var mockLog = require('dgeni/lib/mocks/log')(/* true */);
var mockReadFilesProcessor = {
  basePath: path.resolve('some/path')
};

describe("debugDumpProcessor", function() {
  it("should write out the docs to a file", function() {
    var processor = processorFactory(mockLog, mockReadFilesProcessor);
    processor.outputPath = 'build/dump.txt';
    processor.$process([{ val: 'a' }, { val: 'b' }]);
    expect(writeFileSpy).toHaveBeenCalledWith(path.resolve('some/path/build/dump.txt'), "[ { val: 'a' }, { val: 'b' } ]");
  });
});
@@ -152,24 +152,122 @@
 ocessor');%0A%0A
+var mockPackage = require('dgeni-packages/base/spec/mockPackage');%0Avar Dgeni = require('dgeni');%0A%0A
 var writeFil
@@ -384,66 +384,8 @@
 );%0A%0A
-var mockLog = require('dgeni/lib/mocks/log')(/* true */);%0A
 var 
@@ -554,16 +554,163 @@
 ion() %7B%0A
+    var dgeni = new Dgeni(%5BmockPackage()%5D);%0A    var injector = dgeni.configureInjector();%0A    var processor = injector.get('debugDumpProcessor');%0A%0A
     var 

use configureInjector and mockPackage