File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,6 +209,12 @@ When "a settings hashtable with an? (.+) in it" {
209209 " SecureString" {
210210 $Settings.TestCase = ConvertTo-SecureString - AsPlainText - Force - String " Password"
211211 }
212+ " ScriptBlock" {
213+ $Settings.TestCase = { Get-ChildItem }
214+ }
215+ " SwitchParameter" {
216+ $Settings.TestCase = [switch ]$true
217+ }
212218 " Uri" {
213219 $Settings.TestCase = [Uri ]" http://HuddledMasses.org"
214220 }
Original file line number Diff line number Diff line change @@ -413,3 +413,14 @@ Feature: Serialize Hashtables or Custom Objects
413413 And the string version should match "Uri 'http://huddledmasses.org/'"
414414 And the string version should match "Uri 'http://poshcode.org'"
415415
416+ @Serialization @ScriptBlock
417+ Scenario Outline : Should be able to serialize ScriptBlocks
418+ Given a settings hashtable with a ScriptBlock in it
419+ When we convert the settings to metadata
420+ Then the string version should match "TestCase = \( ?ScriptBlock '"
421+
422+ @Serialization
423+ Scenario Outline : Should serialize Switch statements as booleans
424+ Given a settings hashtable with a SwitchParameter in it
425+ When we convert the settings to metadata
426+ Then the string version should match "TestCase = \` $True"
You can’t perform that action at this time.
0 commit comments