You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a few issues while working through PSKoans\Cmdlets 2\AboutCsvCmdlets.Koans.ps1
Context "The Problematic Assertions"
Typo on line 59 - $TestDrove should be $TestDrive
It 'stores the data accurately' {
# Now if we read the file as text, let's see what's inside!
$FileContents = Get-Content -Path "$TestDrove/Data.csv"
...
}
Lines 94 and 101: $Letters and $PipeDelimitedCsvPath are set but never used
Lines 109 and 114: GetType() returns an object, not a string, so the Pester tests will always fail. Can be resolved by using GetType().FullName
Also, line 111 should read -Not -BeNullOrEmpty rather than -NotBeNullOrEmpty
It 'imports the stored data as PSCustomObjects' {
# Our original data type is a .NET numeric type.
'System.____.____' | Should -Be $Objects[0].GetType()
$ImportedData | Should -NotBeNullOrEmpty
# What comes back after the import?
'System.____.____.____' | Should -Be $ImportedData[0].GetType()
}
Line 153: Need to use -Not -BeNullOrEmpty rather than -NotBeNullOrEmpty
It 'allows you to specify the delimiter' {
...
$Animals.Name | Should -NotBeNullOrEmpty
$Animals[0].Animal | Should -Be 'Dog'
$Animals[1].Name | Should -Be 'Alice'
...
}
Lines 203-208: These tests are failing due to reading #TYPE information from the CSV. Can be resolved by adding -NoTypeInformation on line 201
It 'works the same way as Export-Csv' {
$CsvString = $Objects | ConvertTo-Csv
'"____","____"' | Should -Be $CsvString[0]
'"__","__"' | Should -Be $CsvString[1]
'"__","__"' | Should -Be $CsvString[2]
'"__","__"' | Should -Be $CsvString[3]
'"__","__"' | Should -Be $CsvString[4]
'"__","__"' | Should -Be $CsvString[5]
}
Context "Additional Information"
Happy to follow up with a pull request to address these
Cheers,
John
The text was updated successfully, but these errors were encountered:
Describe "Koan Bug, Issue, or Help Request"
Hello,
I noticed a few issues while working through PSKoans\Cmdlets 2\AboutCsvCmdlets.Koans.ps1
Context "The Problematic Assertions"
Typo on line 59 -
$TestDrove
should be$TestDrive
Lines 94 and 101:
$Letters
and$PipeDelimitedCsvPath
are set but never usedLines 109 and 114:
GetType()
returns an object, not a string, so the Pester tests will always fail. Can be resolved by usingGetType().FullName
Also, line 111 should read
-Not -BeNullOrEmpty
rather than-NotBeNullOrEmpty
Line 153: Need to use
-Not -BeNullOrEmpty
rather than-NotBeNullOrEmpty
Lines 203-208: These tests are failing due to reading #TYPE information from the CSV. Can be resolved by adding
-NoTypeInformation
on line 201Context "Additional Information"
Happy to follow up with a pull request to address these
Cheers,
John
The text was updated successfully, but these errors were encountered: