Increase code coverage #22

Merged
OCram85 merged 34 commits from dev into master 2018-03-21 12:16:09 +01:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit f33a243191 - Show all commits

View File

@ -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 {

View File

@ -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
} }
} }
} }