Skip to content

Commit

Permalink
Load Dummy types (incl. [__]) globally (#122)
Browse files Browse the repository at this point in the history
* MODULE: Import dummy types globally
So that Pester's Should -BeOfType can see them

* MODULE: Re-do switch logic to detect types properly
  • Loading branch information
vexx32 committed Jan 4, 2019
1 parent 80441dc commit 157baa8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 10 additions & 0 deletions PSKoans/DummyTypes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Only attempt to load dummy types if they're not already present in the session

switch ($true) {
{ -not ('FillerType' -as [type]) } {
class FillerType {}
}
{ -not ('__' -as [type]) } {
class __ : FillerType {}
}
}
Binary file modified PSKoans/PSKoans.psd1
Binary file not shown.
3 changes: 0 additions & 3 deletions PSKoans/PSKoans.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

#region SupportingClasses

class FILL_ME_IN {}
class __ : FILL_ME_IN {}

class KoanAttribute : Attribute {
[uint32] $Position
[string] $Module = '_powershell'
Expand Down

0 comments on commit 157baa8

Please sign in to comment.