Skip to content

Commit

Permalink
Fix test assertions for Pester v4
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterPOSH committed Mar 15, 2017
1 parent e36b812 commit 16b4ed0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Tests/Integration/Basic.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ try {
Context 'Should update the global variable PSRemotely' {

It 'Should clear out Session Hashtable' {
$Global:PSRemotely.SessionHashTable | Should BeNullOrEmpty
$Global:PSRemotely.SessionHashTable.Count | Should Be 0
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/Integration/ConfigData.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Foreach ($RemotelyTestFile in $RemotelyTestFiles) {

It 'Should have a NodeMap for the Nodes created' {
$Global:PSRemotely.NodeMap.count | Should Be 2
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq 'localhost'}) | Should Be $True
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq "$env:ComputerName"}) | Should Be $True
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq 'localhost'}) | Should NOT BeNullOrEmpty
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq "$env:ComputerName"}) | Should NOT BeNullOrEmpty
}

It 'Should have the PathStatus true for the NodeMap (implies the PSRemotelyNodePath exists)' {
Expand Down Expand Up @@ -242,7 +242,7 @@ Foreach ($RemotelyTestFile in $RemotelyTestFiles) {
Context 'Should update the global variable PSRemotely' {

It 'Should clear out Session Hashtable' {
$Global:PSRemotely.SessionHashTable | Should BeNullOrEmpty
$Global:PSRemotely.SessionHashTable.Count | Should Be 0
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion Tests/Integration/Generic.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Describe "PSRemotely only accepts *.PSRemotely.ps1 extension files" {

It 'Should throw an error' {
$PSRemotelyError | Should Not BeNullOrEmpty
$PSRemotelyError -like '* is not a *.PSRemotely.ps1 file.' | Should be $True
}

It 'Should throw a custom error message' {
($PSRemotelyError -like '* is not a *.PSRemotely.ps1 file.') | Should NOT BeNullOrEmpty
}
}
2 changes: 1 addition & 1 deletion Tests/Integration/artifacts/ConfigData.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"NodeName" : "localhost",
"ServiceName" : "bits",
"Type" : "Compute"
"Type" : "Storage"
}
]
}
Expand Down

0 comments on commit 16b4ed0

Please sign in to comment.