-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
.test.ps1
27 lines (24 loc) · 974 Bytes
/
.test.ps1
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
# Synopsis: Expected results.
task Test-Script1 {
($r = .\Test-Script1.ps1)
equals $r[0] 'Local message: Default local message.'
equals $r[1] 'Local message: New local message.'
equals $r[2] 'Local message: New custom message.'
equals $r[3] 'Global message: Default global message.'
}
# Synopsis: $r[2] is different.
task Test-Module1-as-command {
($r = Invoke-PowerShell -NoProfile -Command .\Test-Module1.ps1)
equals $r[0] 'Local message: Default local message.'
equals $r[1] 'Local message: New local message.'
equals $r[2] 'Local message: New local message.'
equals $r[3] 'Global message: Default global message.'
}
# Synopsis: $r[2] and $r[3] are different.
task Test-Module1-as-file {
($r = Invoke-PowerShell -NoProfile -File .\Test-Module1.ps1)
equals $r[0] 'Local message: Default local message.'
equals $r[1] 'Local message: New local message.'
equals $r[2] 'Local message: New local message.'
equals $r[3] 'Global message: New custom message.'
}