diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-18 10:53:57 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-18 10:53:57 +0100 |
commit | 52206ce9d0353bc01b7238fe86aa19a92ec6effb (patch) | |
tree | 21689d1508df2ba9c6c067ba0f5f2e8544a24b87 /test/mock.js | |
parent | 1de9d5683b30b4f24c2aba4f796a6d77f0ce7004 (diff) | |
download | gitbook-52206ce9d0353bc01b7238fe86aa19a92ec6effb.zip gitbook-52206ce9d0353bc01b7238fe86aa19a92ec6effb.tar.gz gitbook-52206ce9d0353bc01b7238fe86aa19a92ec6effb.tar.bz2 |
Add test for copy of assets in website generator
Diffstat (limited to 'test/mock.js')
-rw-r--r-- | test/mock.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/mock.js b/test/mock.js index 701df99..fe8ed7a 100644 --- a/test/mock.js +++ b/test/mock.js @@ -5,6 +5,7 @@ var path = require('path'); var Book = require('../').Book; var NodeFS = require('../lib/fs/node'); +var fs = require('../lib/utils/fs'); require('./assertions'); @@ -22,7 +23,10 @@ function setupFS(_fs, rootFolder, files) { if (_.isObject(buf)) buf = JSON.stringify(buf); if (_.isString(buf)) buf = new Buffer(buf, 'utf-8'); - return _fs.write(filename, buf); + return fs.mkdirp(path.dirname(filename)) + .then(function() { + return fs.writeFile(filename, buf); + }); }); }, Q()) .value() |