Merge pull request #1519 from PowerShell/vors/json

Fix ConvertFrom-Json to handle mutlilines
This commit is contained in:
Sergei Vorobev authored and GitHub committed 2016-07-26 14:37:36 -07:00
commit 52569380c7
2 files changed
+22

No files matched your search

@@ -0,0 +1,16 @@
Describe 'ConvertFrom-Json' {
It 'can convert a single-line object' {
('{"a" : "1"}' | ConvertFrom-Json).a | Should Be 1
}
It 'can convert one string-per-object' {
$json = @('{"a" : "1"}', '{"a" : "x"}') | ConvertFrom-Json
$json.Count | Should Be 2
$json[1].a | Should Be 'x'
}
It 'can convert mutli-line object' {
$json = @('{"a" :', '"x"}') | ConvertFrom-Json
$json.a | Should Be 'x'
}
}