-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathrename_test.js
More file actions
108 lines (93 loc) · 3.81 KB
/
rename_test.js
File metadata and controls
108 lines (93 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'use strict';
var grunt = require('grunt');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
exports.rename = {
setUp: function(done) {
done();
},
one: function(test) {
test.expect(2);
test.ok(grunt.file.exists('tmp/1'), 'tmp/1 should exist');
test.ok(!grunt.file.exists('test/files/1'), 'test/files/1 should NOT exist');
test.done();
},
two: function(test) {
test.expect(2);
test.ok(grunt.file.exists('tmp/2'), 'tmp/2 should exist');
test.ok(!grunt.file.exists('test/files/2'), 'test/files/2 should NOT exist');
test.done();
},
three: function(test) {
test.expect(2);
test.ok(grunt.file.exists('tmp/three'), 'tmp/three should exist');
test.ok(!grunt.file.exists('test/files/3'), 'test/files/3 should NOT exist');
test.done();
},
four: function(test) {
test.expect(2);
test.ok(grunt.file.exists('tmp/tmp/4'), 'tmp/tmp/1 should exist');
test.ok(!grunt.file.exists('test/files/4'), 'test/files/4 should NOT exist');
test.done();
},
five: function(test) {
test.expect(2);
test.ok(grunt.file.exists('tmp/tmp/five'), 'tmp/tmp/five should exist');
test.ok(!grunt.file.exists('test/files/5'), 'test/files/5 should NOT exist');
test.done();
},
six: function(test) {
test.expect(2);
test.ok(grunt.file.exists('./6'), './6 should exist');
test.ok(!grunt.file.exists('test/files/6'), 'test/files/6 should NOT exist');
test.done();
},
seven: function(test) {
test.expect(2);
test.ok(grunt.file.exists('7'), './7 should exist');
test.ok(!grunt.file.exists('test/files/7'), 'test/files/7 should NOT exist');
test.done();
},
eight: function(test) {
test.expect(2);
test.ok(grunt.file.exists('eight'), './eight should exist');
test.ok(!grunt.file.exists('test/files/8'), 'test/files/8 should NOT exist');
test.done();
},
nineAndTen: function(test) {
test.expect(5);
test.ok(grunt.file.exists('tmp/tmp/tmp/9'), 'tmp/tmp/tmp/9 should exist');
test.ok(grunt.file.exists('tmp/tmp/tmp/10'), 'tmp/tmp/tmp/10 should exist');
test.ok(!grunt.file.exists('test/files/9'), 'test/files/9 should NOT exist');
test.ok(!grunt.file.exists('test/files/10'), 'test/files/10 should NOT exist');
test.equal(grunt.file.read('test/files/sleep'), 'Slept', 'Sleep should have finished');
test.done();
},
twoHundreds: function(test) {
test.expect(7);
test.ok(grunt.file.exists('tmp/20/test/files/201'), 'tmp/20/test/files/201 should exist');
test.ok(grunt.file.exists('tmp/20/test/files/202'), 'tmp/20/test/files/202 should exist');
test.ok(grunt.file.exists('tmp/20/test/files/203'), 'tmp/20/test/files/203 should exist');
test.ok(!grunt.file.exists('test/files/201'), 'test/files/201 should NOT exist');
test.ok(!grunt.file.exists('test/files/202'), 'test/files/202 should NOT exist');
test.ok(!grunt.file.exists('test/files/203'), 'test/files/203 should NOT exist');
test.equal(grunt.file.read('test/files/sleep'), 'Slept', 'Sleep should have finished');
test.done();
},
};