A PowerShell mocking framework
PowerShell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
specs
src
PMock.nuspec
README.md
logo.png

README.md

PMock

A PowerShell mocking framework

Usage

To use this module you need to install the module from PSGet using the command:

Install-Module PMock

Once you have module installed this example overrides a function name by creating a mock module:

$functionName = 'Test-First'
$module = New-MockModule $functionName { "Override-First" }
Import-Module $module
$first = Test-First
$wasCalled = Assert-Mock $functionName
$wasCalled.should.be($true)
Remove-Module $module

Please check out more examples in the /specs folder.