Skip to content

Commit 08df6bf

Browse files
committed
Add a couple tests to improve coverage
1 parent f24366d commit 08df6bf

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Specs/Configuration.Steps.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

Specs/Serialization.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)