mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Convert Pester tests to ASCII
Instead of UTF-8 with BOM. Resolves #417.
This commit is contained in:
1 parent
901160cb78
commit
0aaf74bdcc
52 files changed
+648
-517
No files matched your search
@@ -1,51 +1,51 @@
|
||||
Describe "ConvertFrom-StringData" {
|
||||
$sampleData = @'
|
||||
foo = 0
|
||||
bar = 1
|
||||
bazz = 2
|
||||
'@
|
||||
|
||||
It "Should not throw when called with just the stringdata switch" {
|
||||
{ ConvertFrom-StringData -StringData 'a=b' } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Should return a hashtable" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').GetType().Name | Should Be "Hashtable"
|
||||
}
|
||||
|
||||
It "Should throw if not in x=y format" {
|
||||
{ ConvertFrom-StringData -StringData 'ab' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a,b' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a b' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a\tb' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a:b' } | Should Throw
|
||||
}
|
||||
|
||||
It "Should return the data on the left side in the key" {
|
||||
$actualValue = ConvertFrom-StringData -StringData 'a=b'
|
||||
|
||||
$actualValue.Keys | Should Be "a"
|
||||
}
|
||||
|
||||
It "Should return the data on the right side in the value" {
|
||||
$actualValue = ConvertFrom-StringData -StringData 'a=b'
|
||||
|
||||
$actualValue.Values | Should Be "b"
|
||||
}
|
||||
|
||||
It "Should return a keycollection for the keys" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').Keys.gettype().Name | Should Be "KeyCollection"
|
||||
}
|
||||
|
||||
It "Should return a valuecollection for the values" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').Values.gettype().Name | Should Be "ValueCollection"
|
||||
}
|
||||
|
||||
It "Should work for multiple lines" {
|
||||
{ ConvertFrom-StringData -StringData $sampleData } | Should Not Throw
|
||||
|
||||
$(ConvertFrom-StringData -StringData $sampleData).Keys | Should Be "foo", "bar", "bazz"
|
||||
|
||||
$(ConvertFrom-StringData -StringData $sampleData).Values | Should Be "0","1","2"
|
||||
}
|
||||
Describe "ConvertFrom-StringData" {
|
||||
$sampleData = @'
|
||||
foo = 0
|
||||
bar = 1
|
||||
bazz = 2
|
||||
'@
|
||||
|
||||
It "Should not throw when called with just the stringdata switch" {
|
||||
{ ConvertFrom-StringData -StringData 'a=b' } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Should return a hashtable" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').GetType().Name | Should Be "Hashtable"
|
||||
}
|
||||
|
||||
It "Should throw if not in x=y format" {
|
||||
{ ConvertFrom-StringData -StringData 'ab' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a,b' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a b' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a\tb' } | Should Throw
|
||||
{ ConvertFrom-StringData -StringData 'a:b' } | Should Throw
|
||||
}
|
||||
|
||||
It "Should return the data on the left side in the key" {
|
||||
$actualValue = ConvertFrom-StringData -StringData 'a=b'
|
||||
|
||||
$actualValue.Keys | Should Be "a"
|
||||
}
|
||||
|
||||
It "Should return the data on the right side in the value" {
|
||||
$actualValue = ConvertFrom-StringData -StringData 'a=b'
|
||||
|
||||
$actualValue.Values | Should Be "b"
|
||||
}
|
||||
|
||||
It "Should return a keycollection for the keys" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').Keys.gettype().Name | Should Be "KeyCollection"
|
||||
}
|
||||
|
||||
It "Should return a valuecollection for the values" {
|
||||
$(ConvertFrom-StringData -StringData 'a=b').Values.gettype().Name | Should Be "ValueCollection"
|
||||
}
|
||||
|
||||
It "Should work for multiple lines" {
|
||||
{ ConvertFrom-StringData -StringData $sampleData } | Should Not Throw
|
||||
|
||||
$(ConvertFrom-StringData -StringData $sampleData).Keys | Should Be "foo", "bar", "bazz"
|
||||
|
||||
$(ConvertFrom-StringData -StringData $sampleData).Values | Should Be "0","1","2"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user