mardi 28 mars 2017

Mock [System.IO.Path]::IsPathRooted() using Pester?

How do I Mock [System.IO.Path]::IsPathRooted() using Pester? I tried the following but no luck.

Describe "Configuration" {
    Mock [System.IO.Path]::IsPathRooted {
        return false
    }

    It "should mock rooted Path" {
        [System.IO.Path]::IsPathRooted("C:\a") | Should Be False
    }

Aucun commentaire:

Enregistrer un commentaire