-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLDEV3931.cfc
34 lines (30 loc) · 1.02 KB
/
LDEV3931.cfc
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
component extends = "org.lucee.cfml.test.LuceeTestCase" labels="image" {
function beforeAll() {
variables.path = getDirectoryFromPath(getCurrenttemplatepath()) & "LDEV3931";
if (!directoryExists(path)) directoryCreate(path)
variables.file = "#path#\test.txt";
}
function run( testResults , testBox ) {
describe( "Testcase for LDEV-3931", function() {
it( title="checking file locking issue in isImageFile()", body=function( currentSpec ) {
fileWrite(variables.file , "This is test file");
isImageFile( variables.file ); // checking not an image file in isImageFile()
try {
fileDelete(variables.file);
var result = "File deleted successfully";
}
catch(any e) {
var result = e.message;
}
expect(result).toBe("File deleted successfully");
expect(fileExists(variables.file)).toBeFalse();
});
});
}
function afterAll() {
if (fileExists(variables.file)) {
var javaIoFile = createObject("java","java.io.File").init(variables.file);
javaIoFile.deleteOnExit();
}
}
}