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
|
var testCases = [
{
name: 'RemoveSimple',
precondition: [
{fullPath:'/a', isDirectory:true},
{fullPath:'/b'}
],
tests: [
function(helper) { helper.remove('/a'); },
function(helper) { helper.remove('/b'); },
function(helper) { helper.remove('/', 'InvalidModificationError'); }
],
postcondition: [
{fullPath:'/a', nonexistent:true},
{fullPath:'/b', nonexistent:true}
],
},
{
name: 'RemoveNonRecursiveWithChildren',
precondition: [
{fullPath:'/a', isDirectory:true},
{fullPath:'/a/b', isDirectory:true},
{fullPath:'/a/c',}
],
tests: [
function(helper) { helper.remove('/a', 'InvalidModificationError'); }
],
postcondition: [
{fullPath:'/a', isDirectory:true},
{fullPath:'/a/b', isDirectory:true},
{fullPath:'/a/c',}
],
},
{
name: 'RemoveRecursiveWithoutChildren',
precondition: [
{fullPath:'/a', isDirectory:true},
],
tests: [
function(helper) { helper.removeRecursively('/a'); }
],
postcondition: [
{fullPath:'/a', nonexistent:true},
],
},
{
name: 'RemoveRecursiveWithChildren',
precondition: [
{fullPath:'/a', isDirectory:true},
{fullPath:'/a/b', isDirectory:true},
{fullPath:'/a/c',}
],
tests: [
function(helper) { helper.removeRecursively('/a'); },
function(helper) { helper.removeRecursively('/', 'InvalidModificationError'); }
],
postcondition: [
{fullPath:'/a', nonexistent:true},
],
},
];
|