|
1 | 1 | Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" |
2 | 2 |
|
3 | | -$cmd = (Get-ToolsetContent).apt.cmd_packages + (Get-ToolsetContent).apt.vital_packages |
4 | | - |
5 | 3 | Describe "Apt" { |
6 | | - |
7 | | - $testCases = $cmd | ForEach-Object { |
8 | | - @{ toolName = $_ } |
9 | | - } |
| 4 | + $packages = (Get-ToolsetContent).apt.cmd_packages + (Get-ToolsetContent).apt.vital_packages |
| 5 | + $testCases = $packages | ForEach-Object { @{ toolName = $_ } } |
10 | 6 |
|
11 | 7 | It "<toolName> is available" -TestCases $testCases { |
12 | | - if ($toolName -eq "acl") |
13 | | - { |
14 | | - $toolName = "getfacl" |
15 | | - } |
16 | | - |
17 | | - if ($toolName -eq "aria2") |
18 | | - { |
19 | | - $toolName = "aria2c" |
20 | | - } |
21 | | - |
22 | | - if ($toolName -eq "p7zip-full") |
23 | | - { |
24 | | - $toolName = "p7zip" |
25 | | - } |
26 | | - |
27 | | - if ($toolName -eq "subversion") |
28 | | - { |
29 | | - $toolName = "svn" |
30 | | - } |
31 | | - |
32 | | - if ($toolName -eq "sphinxsearch") |
33 | | - { |
34 | | - $toolName = "searchd" |
35 | | - } |
36 | | - |
37 | | - if ($toolName -eq "binutils") |
38 | | - { |
39 | | - $toolName = "strings" |
40 | | - } |
41 | | - |
42 | | - if ($toolName -eq "coreutils") |
43 | | - { |
44 | | - $toolName = "tr" |
| 8 | + switch ($toolName) { |
| 9 | + "acl" { $toolName = "getfacl"; break } |
| 10 | + "aria2" { $toolName = "aria2c"; break } |
| 11 | + "p7zip-full" { $toolName = "p7zip"; break } |
| 12 | + "subversion" { $toolName = "svn"; break } |
| 13 | + "sphinxsearch" { $toolName = "searchd"; break } |
| 14 | + "binutils" { $toolName = "strings"; break } |
| 15 | + "coreutils" { $toolName = "tr"; break } |
| 16 | + "net-tools" { $toolName = "netstat"; break } |
| 17 | + "mercurial" { $toolName = "hg"; break } |
| 18 | + "findutils" { $toolName = "find"; break } |
45 | 19 | } |
46 | 20 |
|
47 | | - if ($toolName -eq "net-tools") |
48 | | - { |
49 | | - $toolName = "netstat" |
50 | | - } |
51 | | - |
52 | | - if ($toolName -eq "mercurial") |
53 | | - { |
54 | | - $toolName = "hg" |
55 | | - } |
56 | | - |
57 | | - if ($toolName -eq "findutils") |
58 | | - { |
59 | | - $toolName = "find" |
60 | | - } |
61 | 21 | (Get-Command -Name $toolName).CommandType | Should -BeExactly "Application" |
62 | 22 | } |
63 | 23 | } |
0 commit comments