1 | helper = require '../helper'
|
2 | color = require 'color'
|
3 | fs = require 'fs'
|
4 | file = require 'file'
|
5 | chai = require 'chai'
|
6 | should = chai.should()
|
7 |
|
8 | describe 'generator/basic/copy', ->
|
9 | describe '#generate()', ->
|
10 | it 'copies all files from src/assets/public to dist/', (done)->
|
11 | publicSrcDir = "#{helper.srcPath}/assets/public"
|
12 | publicDistDir = "#{helper.distPath}"
|
13 |
|
14 | file.walkSync publicSrcDir, (dirPath, dirs, files)->
|
15 | files.should.be.a 'array'
|
16 | files.length.should.not.equal 0
|
17 |
|
18 | distPath = dirPath.replace(publicSrcDir, publicDistDir)
|
19 | for file in files
|
20 | fullFilePath = "#{distPath}/#{file}"
|
21 | console.log " checking file #{fullFilePath.yellow}"
|
22 | fs.existsSync(fullFilePath).should.be.true
|
23 |
|
24 | done()
|