mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
17 lines
475 B
PowerShell
17 lines
475 B
PowerShell
Describe 'ConvertFrom-Json' -tags "CI" {
|
|
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'
|
|
}
|
|
}
|