2017-04-01 02:01:44 -04:00
|
|
|
const testPackage = require('../../helpers/test-package');
|
|
|
|
const Dgeni = require('dgeni');
|
|
|
|
const factory = require('./copyContentAssets');
|
|
|
|
|
2017-04-01 14:34:10 -04:00
|
|
|
describe('extractDecoratedClasses processor', function() {
|
2017-04-01 02:01:44 -04:00
|
|
|
let dgeni, injector, processor;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
dgeni = new Dgeni([testPackage('angular.io-package')]);
|
|
|
|
injector = dgeni.configureInjector();
|
|
|
|
processor = injector.get('copyContentAssetsProcessor');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should exist', () => {
|
|
|
|
expect(processor).toBeDefined();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should call copyFolder with each mapping', () => {
|
|
|
|
const mockCopyFolder = jasmine.createSpy();
|
|
|
|
processor = factory(mockCopyFolder);
|
|
|
|
processor.assetMappings.push({ from: 'a/b/c', to: 'x/y/z' });
|
|
|
|
processor.assetMappings.push({ from: '1/2/3', to: '4/5/6' });
|
|
|
|
processor.$process();
|
|
|
|
expect(mockCopyFolder).toHaveBeenCalledWith('a/b/c', 'x/y/z');
|
|
|
|
expect(mockCopyFolder).toHaveBeenCalledWith('1/2/3', '4/5/6');
|
|
|
|
});
|
2017-04-01 14:34:10 -04:00
|
|
|
});
|