forked from cake-contrib/Cake.DoInDirectory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cake
43 lines (35 loc) · 937 Bytes
/
test.cake
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
#reference "Cake.DoInDirectory/bin/Release/net6.0/Cake.DoInDirectory.dll"
Setup((ctx) =>
{
CreateDirectory("tests");
CleanDirectory("tests");
CopyDirectory("Cake.DoInDirectory/bin", "tests");
});
Task("Test")
.Does(() =>
{
if (!DirectoryExists("tests"))
{
throw new Exception("[Before] Expected tests dir to exist");
}
if (DirectoryExists("Release"))
{
throw new Exception("[Before] Expected Release dir not to exist");
}
DoInDirectory("tests", () =>
{
if (!DirectoryExists("Release"))
{
throw new Exception("Expected Release dir to exist");
}
});
if (!DirectoryExists("tests"))
{
throw new Exception("[After] Expected tests dir to exist");
}
if (DirectoryExists("Release"))
{
throw new Exception("[After] Expected Release dir not to exist");
}
});
RunTarget("Test");