|
1 | | -describe Image2Docker { |
2 | | - $ModuleName = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Leaf |
3 | | - Write-Verbose -Message ('Module name is {0}' -f $ModuleName) |
| 1 | +Describe Image2Docker { |
| 2 | + $ModuleName = 'Image2Docker' |
| 3 | + WrIte-Verbose -Message ('Module name is {0}' -f $ModuleName) |
4 | 4 |
|
5 | | - ### Remove the module if it's already imported, then re-import it (in case code changed) |
| 5 | + ### Remove the module if It's already imported, then re-import It (in case code changed) |
6 | 6 | Remove-Module -Name $ModuleName -ErrorAction Ignore |
7 | | - #Import-Module -Name (Split-Path -Path $PSScriptRoot -Parent) |
| 7 | + #Import-Module -Name (SplIt-Path -Path $PSScriptRoot -Parent) |
8 | 8 | Import-Module -Name $PSScriptRoot\..\Image2Docker.psd1 |
9 | 9 |
|
10 | | - context 'Public-facing PowerShell commands' { |
11 | | - it 'Has a ConvertTo-Dockerfile command' { |
| 10 | + Context 'Public-facing PowerShell commands' { |
| 11 | + It 'Has a ConvertTo-Dockerfile command' { |
12 | 12 | (Get-Command -Module $ModuleName -Name ConvertTo-Dockerfile).Count | Should Be 1 |
13 | 13 | } |
14 | 14 |
|
15 | | - it 'Has a Get-WindowsArtifacts command' { |
| 15 | + It 'Has a Get-WindowsArtifacts command' { |
16 | 16 | (Get-Command -Module $ModuleName -Name Get-WindowsArtifacts).Count | Should Be 1 |
17 | 17 | } |
18 | 18 | } |
19 | 19 |
|
20 | | - context 'Private / internal PowerShell commands' { |
| 20 | + Context 'Private / internal PowerShell commands' { |
21 | 21 | InModuleScope -ModuleName $ModuleName -ScriptBlock { |
22 | | - it 'Has a GenerateDockerfile command' { |
| 22 | + It 'Has a GenerateDockerfile command' { |
23 | 23 | (Get-Command -Module $ModuleName -Name GenerateDockerfile).Count | Should Be 1 |
24 | 24 | } |
25 | | - it 'Has a GetImageType command' { |
| 25 | + It 'Has a GetImageType command' { |
26 | 26 | (Get-Command -Module $ModuleName -Name GetImageType).Count | Should Be 1 |
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | 30 |
|
31 | | - context 'Test ConvertTo-Dockerfile command' { |
32 | | - it 'Should throw when -ImagePath parameter value is invalid' { |
| 31 | + Context 'Artifact Discovery' { |
| 32 | + foreach ($artifact in Get-WindowsArtifacts) { |
| 33 | + |
| 34 | + It "Has an $artifact Artifact" { |
| 35 | + Get-WindowsArtifacts | Where-Object {$_ -match $artifact }| Should Match $artifact |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + Context 'Test ConvertTo-Dockerfile command' { |
| 40 | + It 'Should throw when -ImagePath parameter value is invalid' { |
33 | 41 | { ConvertTo-Dockerfile -ImagePath c:\invalid\path.wim } | Should throw |
34 | 42 | } |
35 | 43 | } |
|
0 commit comments