1+ # requires -Module ModuleBuilder
12Describe " MoveUsingStatements" {
2-
33 Context " Necessary Parameters" {
44 $CommandInfo = InModuleScope ModuleBuilder { Get-Command MoveUsingStatements }
55
@@ -96,7 +96,7 @@ Describe "MoveUsingStatements" {
9696 $MoveUsingStatementsCmd = InModuleScope ModuleBuilder {
9797 $null = Mock Write-Warning {}
9898 $null = Mock Set-Content {}
99- $null = Mock Write-Debug {} - ParameterFilter {$Message -eq " No Using Statement Error found." }
99+ $null = Mock Write-Debug {} - ParameterFilter { $Message -eq " No using statement errors found." }
100100
101101 { param ($RootModule )
102102 ConvertToAst $RootModule | MoveUsingStatements
@@ -113,18 +113,17 @@ Describe "MoveUsingStatements" {
113113 Assert-MockCalled - CommandName Set-Content - Times 0 - ModuleName ModuleBuilder
114114 }
115115
116- It ' Should not do anything when there are no Using Statements Errors' {
117-
116+ It ' Should not do anything when there are no using statement errors' {
118117 $testModuleFile = " $TestDrive \MyModule.psm1"
119- $PSM1File = " Using namespace System.IO; function x {}"
118+ $PSM1File = " using namespace System.IO; function x {}"
120119 Set-Content $testModuleFile - value $PSM1File - Encoding UTF8
121120
122- & $MoveUsingStatementsCmd - RootModule $testModuleFile
121+ & $MoveUsingStatementsCmd - RootModule $testModuleFile - Debug
123122
124- Assert-MockCalled - CommandName Write-Debug - Times 1 - ModuleName ModuleBuilder
125- Assert-MockCalled - CommandName Set-Content - Times 0 - ModuleName ModuleBuilder
126123 (Get-Content - Raw $testModuleFile ).Trim() | Should - Be $PSM1File
127124
125+ Assert-MockCalled - CommandName Set-Content - Times 0 - ModuleName ModuleBuilder
126+ Assert-MockCalled - CommandName Write-Debug - Times 1 - ModuleName ModuleBuilder
128127 }
129128
130129
0 commit comments