Add some tests for scoop config

This commit is contained in:
Richard Kuhnt
2018-08-07 20:11:38 +02:00
parent 3183f0052f
commit 4ed6265ed7
+4 -1
View File
@@ -2,7 +2,7 @@
. "$psscriptroot\..\lib\config.ps1"
describe "hashtable" {
$json = '{ "one": 1, "two": [ { "a": "a" }, "b", 2 ], "three": { "four": 4 } }'
$json = '{ "one": 1, "two": [ { "a": "a" }, "b", 2 ], "three": { "four": 4 }, "five": true, "six": false, "seven": "\/Date(1529917395805)\/" }'
it "converts pscustomobject to hashtable" {
$obj = convertfrom-json $json
@@ -13,5 +13,8 @@ describe "hashtable" {
$ht.two[1] | should be "b"
$ht.two[2] | should beexactly 2
$ht.three.four | should beexactly 4
$ht.five | should beexactly $true
$ht.six | should beexactly $false
[System.DateTime]::Equals($ht.seven, $(New-Object System.DateTime (2018, 06, 25, 09, 03, 15, 805))) | should be $true
}
}