Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
BOM is required for PowerShell to properly recognize UTF-8 encoding.
  • Loading branch information
PetSerAl committed Feb 18, 2016
1 parent 7dcc6e5 commit 8de63db
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Functions/Mock.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Set-StrictMode -Version Latest
Set-StrictMode -Version Latest

function FunctionUnderTest
{
Expand Down Expand Up @@ -1579,3 +1579,21 @@ Describe '$args handling' {
}

}

Describe 'Single quote in command/module name' {

New-Module "Module '‘’‚‛" {
Function NormalCommandName { 'orig' }
New-Item "Function::Command '‘’‚‛" -Value { 'orig' }
} | Import-Module

It 'Command with single quote in module name should be mockable' {
Mock NormalCommandName { 'mock' }
NormalCommandName | Should Be mock
}
It 'Command with single quote in name should be mockable' {
Mock "Command '‘’‚‛" { 'mock' }
& "Command '‘’‚‛" | Should Be mock
}

}

0 comments on commit 8de63db

Please sign in to comment.