Skip to content

Commit

Permalink
Add test for Strict Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
iSazonov committed May 2, 2018
1 parent a792bd4 commit 31ab358
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/powershell/engine/Help/HelpSystem.Tests.ps1
Expand Up @@ -39,7 +39,7 @@ function GetCurrentUserHelpRoot {

Describe "Validate that <pshome>/<culture>/default.help.txt is present" -Tags @('CI') {

It "Get-Help returns information about the help system." {
It "Get-Help returns information about the help system" {

$help = Get-Help
$help.Name | Should -Be "default"
Expand All @@ -48,6 +48,20 @@ Describe "Validate that <pshome>/<culture>/default.help.txt is present" -Tags @(
}
}

Describe "Validate that the Help function can Run in strict mode" -Tags @('CI') {

It "Help doesn't fail when strict mode is on" {

$help = & {
# run in nested scope to keep strict mode from affecting other tests
Set-StrictMode -Version Latest
Help
}
# the help function renders the help content as text so just verify that there is content
$help | Should -Not -BeNullOrEmpty $true
}
}

Describe "Validate that get-help works for CurrentUserScope" -Tags @('CI') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
Expand Down

0 comments on commit 31ab358

Please sign in to comment.