mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Sync to Doug's 6.5.3 release
This commit is contained in:
@@ -42,4 +42,25 @@ Describe "Tests" {
|
||||
$data[0].p1 | Should be "a"
|
||||
$data[1].p1 | Should be "b"
|
||||
}
|
||||
|
||||
It "Should take Paths from parameter".PadRight(90) {
|
||||
$data = Import-Excel -Path (Get-ChildItem -Path $PSScriptRoot -Filter "TestData?.xlsx").FullName
|
||||
$data.count | Should be 4
|
||||
$data[0].cola | Should be 1
|
||||
$data[2].cola | Should be 5
|
||||
}
|
||||
|
||||
It "Should take Paths from pipeline".PadRight(90) {
|
||||
$data = (Get-ChildItem -Path $PSScriptRoot -Filter "TestData?.xlsx").FullName | Import-Excel
|
||||
$data.count | Should be 4
|
||||
$data[0].cola | Should be 1
|
||||
$data[2].cola | Should be 5
|
||||
}
|
||||
|
||||
It "Should support PipelineVariable".PadRight(90) {
|
||||
$data = Import-Excel $PSScriptRoot\Simple.xlsx -PipelineVariable 'Pv' | ForEach-Object { $Pv.p1 }
|
||||
$data.count | Should be 2
|
||||
$data[0] | Should be "a"
|
||||
$data[1] | Should be "b"
|
||||
}
|
||||
}
|
||||
BIN
__tests__/ImportExcelTests/TestData1.xlsx
Normal file
BIN
__tests__/ImportExcelTests/TestData1.xlsx
Normal file
Binary file not shown.
BIN
__tests__/ImportExcelTests/TestData2.xlsx
Normal file
BIN
__tests__/ImportExcelTests/TestData2.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user