Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Get-Module Pester, m | Remove-Module
  2. Import-Module Pester -MaximumVersion 4.9.9
  3. New-Module -Name m -ScriptBlock {
  4. function a { "hello" }
  5. function b { a }
  6.  
  7. Export-ModuleMember -Function b
  8. } | Import-Module
  9.  
  10.  
  11. Describe "m" {
  12. It "can't see 'a'" {
  13. { a } | Should -Throw
  14. }
  15.  
  16. It "but it can mock 'a'" {
  17. Mock a -ModuleName m { "fuuuu" }
  18.  
  19. b | Should -Be "fuuuu"
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement