forked from StartAutomating/PSSVG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSSVG.tests.ps1
More file actions
45 lines (43 loc) · 1.6 KB
/
PSSVG.tests.ps1
File metadata and controls
45 lines (43 loc) · 1.6 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
describe PSSVG {
context 'Generates SVGs' {
it 'Has Pleanty of /Examples' {
Get-Module PSSVG |
Split-Path |
Join-Path -ChildPath Examples |
Get-ChildItem -Filter *.PSSVG.ps1 |
ForEach-Object {
& $_.Fullname |
ForEach-Object {
$_.GetType() | Should -Be ([IO.FileInfo])
}
}
}
it 'Makes SVGs Pretty Quickly' {
Get-Module PSSVG |
Split-Path |
Join-Path -ChildPath Examples |
Get-ChildItem -Filter *.PSSVG.ps1 |
ForEach-Object {
$fileInfo = $_
(Measure-Command {
& $fileInfo.Fullname
}).TotalSeconds |
Should -BeLessThan 1 # Honestly, it should only be a few milliseconds, just leaving breathing room in case the test machine is slow.
}
}
}
context 'Converting SVGs' {
it 'Can convert SVGs to PSSVG' {
ConvertTo-PSSVG https://raw.githubusercontent.com/StartAutomating/PSSVG/main/Assets/PSSVG.svg |
ForEach-Object {
$_.GetType() | Should -Be ([scriptblock])
}
Get-ChildItem -Path $PSScriptRoot -Filter *.svg |
Select-Object -First 1 |
ConvertTo-PSSVG |
ForEach-Object {
$_.GetType() | Should -Be ([scriptblock])
}
}
}
}