UNPKG

785 Btext/coffeescriptView Raw
1helper = require '../helper'
2color = require 'color'
3fs = require 'fs'
4file = require 'file'
5chai = require 'chai'
6should = chai.should()
7
8describe '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()