Permalink
Browse files

[wip] Tests: cp & mv

  • Loading branch information...
1 parent 8792ddb commit 53710aed24928965a195fca56a9c343f622b865c @filipediasf filipediasf committed Jan 5, 2013
Showing with 37 additions and 8 deletions.
  1. +5 −0 test/helpers/assets/.file
  2. +2 −0 test/tasks.js
  3. +21 −8 test/tasks/cp.js
  4. +9 −0 test/tasks/mv.js
@@ -0,0 +1,5 @@
+Hi there, {{name}}
+
+{{body}}
+
+{{signature}}
View
@@ -1,4 +1,5 @@
var cp = require('./tasks/cp'),
+ mv = require('./tasks/mv'),
chmod = require('./tasks/chmod'),
mkdir = require('./tasks/mkdir'),
rm = require('./tasks/rm'),
@@ -12,6 +13,7 @@ module.exports = function (automaton) {
describe('Built in tasks', function () {
chmod(automaton);
cp(automaton);
+ mv(automaton);
mkdir(automaton);
rm(automaton);
run(automaton);
View
@@ -6,8 +6,8 @@ module.exports = function (automaton) {
describe('cp', function () {
it('should copy a file', function (done) {
var files = {};
- files[__dirname + '/../helpers/assets/file1.json'] = __dirname + '/../tmp/file1.json';
- files[__dirname + '/../helpers/assets/file2'] = __dirname + '/../tmp/';
+ files[__dirname + '/../helpers/assets/file1.json'] = __dirname + '/../tmp/cp/file1.json';
+ files[__dirname + '/../helpers/assets/file2'] = __dirname + '/../tmp/cp/';
automaton.run('cp', {
files: files
@@ -16,9 +16,8 @@ module.exports = function (automaton) {
throw err;
}
- // TODO: test a lot of possibilities!
- expect(isFile(__dirname + '/../tmp/file1.json')).to.be(true);
- expect(isFile(__dirname + '/../tmp/file2')).to.be(true);
+ expect(isFile(__dirname + '/../tmp/cp/file1.json')).to.be(true);
+ expect(isFile(__dirname + '/../tmp/cp/file2')).to.be(true);
done();
});
});
@@ -30,9 +29,23 @@ module.exports = function (automaton) {
it.skip('should work with sources as symlinks (directly or deep)');
it.skip('should work with destinations as symlinks');
it.skip('should copy file and folders permissions');
- it.skip('should pass over the glob options', function () {
- // There is a special case handled inside for the dot option
- // It needs to be tested with special care
+ it('should pass over the glob options', function (done) {
+ var files = {};
+ files[__dirname + '/../helpers/assets/.file'] = __dirname + '/../tmp/cp/';
+
+ automaton.run('cp', {
+ files: files,
+ glob: {
+ dot: false
+ }
+ }, function (err) {
+ if (err) {
+ throw err;
+ }
+
+ expect(isFile(__dirname + '/../tmp/cp/.file')).to.be(false);
+ done();
+ });
});
});
};
View
@@ -0,0 +1,9 @@
+var expect = require('expect.js'),
+ isFile = require('../helpers/util/is-file')
+;
+
+module.exports = function (automaton) {
+ describe('mv', function () {
+ it.skip('mv test 1');
+ });
+};

0 comments on commit 53710ae

Please sign in to comment.