Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-Module Pester, m | Remove-Module
- Import-Module Pester -MaximumVersion 4.9.9
- New-Module -Name m -ScriptBlock {
- function a { "hello" }
- function b { a }
- Export-ModuleMember -Function b
- } | Import-Module
- Describe "m" {
- It "can't see 'a'" {
- { a } | Should -Throw
- }
- It "but it can mock 'a'" {
- Mock a -ModuleName m { "fuuuu" }
- b | Should -Be "fuuuu"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement