Increase code coverage #22
@ -83,7 +83,7 @@ Could not find the required {0} called {1}. Please install the required {0} to r
|
|||||||
}
|
}
|
||||||
|
|
||||||
'PSSnapin' {
|
'PSSnapin' {
|
||||||
if (Get-PSSnapin -Name $Name -Registered) {
|
if (Get-PSSnapin -Name $Name -Registered -ErrorAction SilentlyContinue) {
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -43,7 +43,7 @@ Describe "Test-ModuleName" {
|
|||||||
Test-Module -Name 'foobar2000' -Type PSSnapin | Should -Be $false
|
Test-Module -Name 'foobar2000' -Type PSSnapin | Should -Be $false
|
||||||
}
|
}
|
||||||
It "StopifFails switch should thrown an error" {
|
It "StopifFails switch should thrown an error" {
|
||||||
{Test-Module -Name 'foobar2000' -Type PSSnapin }| Should -Throw
|
{Test-Module -Name 'foobar2000' -Type PSSnapin -StopIfFails }| Should -Throw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Context "Working with modules" {
|
Context "Working with modules" {
|
||||||
@ -59,7 +59,7 @@ Describe "Test-ModuleName" {
|
|||||||
Test-Module -Name 'foobar2000' -Type Module | Should -Be $false
|
Test-Module -Name 'foobar2000' -Type Module | Should -Be $false
|
||||||
}
|
}
|
||||||
It "StopifFails switch should thrown an error" {
|
It "StopifFails switch should thrown an error" {
|
||||||
{Test-Module -Name 'foobar2000' -Type Module }| Should -Throw
|
{Test-Module -Name 'foobar2000' -Type Module -StopIfFails }| Should -Throw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user