【发布时间】:2017-04-19 03:15:49
【问题描述】:
如何使用 Pester 模拟 [System.IO.Path]::IsPathRooted()?我尝试了以下但没有运气。
Describe "Configuration" {
Mock [System.IO.Path]::IsPathRooted {
return false
}
It "should mock rooted Path" {
[System.IO.Path]::IsPathRooted("C:\a") | Should Be False
}
【问题讨论】:
标签: unit-testing powershell testing mocking pester