From 2fdf48165a1470fe8abbef4c01c6f68b816df17e Mon Sep 17 00:00:00 2001 From: Andy Schwartzmeyer Date: Thu, 12 May 2016 13:50:46 -0700 Subject: [PATCH] Clean up Set-PSDebug tests --- test/powershell/Set-PSDebug.Tests.ps1 | 42 +++++++++------------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/test/powershell/Set-PSDebug.Tests.ps1 b/test/powershell/Set-PSDebug.Tests.ps1 index 824514612..ec439db4f 100644 --- a/test/powershell/Set-PSDebug.Tests.ps1 +++ b/test/powershell/Set-PSDebug.Tests.ps1 @@ -1,31 +1,17 @@ Describe "Set-PSDebug" { - # Because it is running through pester, no functions need to be called. Pester should provide plenty - # of output. - It "Should be able to be called without error" { - { Set-PSDebug -Trace 0 } | Should Not Throw + Context "Tracing can be used" { + AfterEach { + Set-PSDebug -Off + } + + It "Should be able to go through the tracing options" { + { Set-PSDebug -Trace 0 } | Should Not Throw + { Set-PSDebug -Trace 1 } | Should Not Throw + { Set-PSDebug -Trace 2 } | Should Not Throw + } + + It "Should be able to set strict" { + { Set-PSDebug -Strict } | Should Not Throw + } } - - It "Should be able to be turned off without error" { - { Set-PSDebug -Off } | Should Not Throw - } - - Context "Validate functionality" { - BeforeEach { - Set-PSDebug -Off - } - - It "Should be able to go through the tracing options" { - { Set-PSDebug -Trace 0 } | Should Not Throw - { Set-PSDebug -Trace 1 } | Should Not Throw - { Set-PSDebug -Trace 2 } | Should Not Throw - } - - It "Should be able to set strict" { - { Set-PSDebug -Strict } | Should Not Throw - } - } - - # final cleanup - - Set-PSDebug -Off }