-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtdocdelete.m
More file actions
71 lines (56 loc) · 3.12 KB
/
Copy pathtdocdelete.m
File metadata and controls
71 lines (56 loc) · 3.12 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
classdef tdocdelete < tDocMaker
%TDOCDELETE Tests for docdelete.
methods ( Test )
function tDeletionIsWarningFree( testCase )
deleter = @() docdelete( testCase.Folder );
testCase.fatalAssertWarningFree( deleter, ...
"docdelete was not warning-free when called on a" + ...
" temporary folder." )
end % tDeletionIsWarningFree
function tFilesAreRemovedAfterConversion( testCase )
docconvert( testCase.ExampleFile, "Root", testCase.Folder )
[removedFiles, removedFolders] = docdelete( testCase.Folder );
testCase.verifyEqual( removedFiles, ...
fullfile( testCase.Folder, "Example.html" ), ...
"docdelete did not delete the example HTML document." )
testCase.verifyEqual( removedFolders, ...
fullfile( testCase.Folder, "resources" ), ...
"docdelete did not delete the resources folder." )
end % tFilesAreRemovedAfterConversion
function tFilesAreRemovedAfterConversionAndRunning( testCase )
outputFiles = docconvert( testCase.ExampleFile, ...
"Root", testCase.Folder );
docrun( outputFiles )
[removedFiles, removedFolders] = docdelete( testCase.Folder );
testCase.verifyEqual( removedFiles, ...
fullfile( testCase.Folder, "Example.html" ), ...
"docdelete did not delete the example HTML document." )
testCase.verifyEqual( removedFolders, ...
fullfile( testCase.Folder, "resources" ), ...
"docdelete did not delete the resources folder." )
end % tFilesAreRemovedAfterConversionAndRunning
function tFilesAreRemovedAfterCompleteBuild( testCase )
outputFiles = docconvert( testCase.ExampleFile, ...
"Root", testCase.Folder );
docrun( outputFiles )
docindex( testCase.Folder )
[removedFiles, removedFolders] = docdelete( testCase.Folder );
testCase.verifyEqual( removedFiles(1), ...
fullfile( testCase.Folder, "Example.html" ), ...
"docdelete did not delete the example HTML document." )
testCase.verifyEqual( removedFiles(2), ...
fullfile( testCase.Folder, "info.xml" ), ...
"docdelete did not delete info.xml." )
testCase.verifyEqual( removedFiles(3), ...
fullfile( testCase.Folder, "helptoc.xml" ), ...
"docdelete did not delete helptoc.xml." )
testCase.verifyEqual( removedFolders(1), ...
fullfile( testCase.Folder, "resources" ), ...
"docdelete did not delete the resources folder." )
testCase.verifyEqual( removedFolders(2), ...
fullfile( testCase.Folder, "helpsearch-v4_en" ), ...
"docdelete did not delete the " + ...
"documentation search database." )
end % tFilesAreRemovedAfterCompleteBuild
end % methods ( Test )
end % classdef