mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-24 04:04:46 +00:00
26 lines
849 B
PowerShell
26 lines
849 B
PowerShell
Describe "Test reading relative paths" {
|
|
It "Should read local file" {
|
|
$actual = Import-Excel -Path ".\testRelative.xlsx"
|
|
$actual | Should Not Be $null
|
|
$actual.Count | Should Not Be 1
|
|
}
|
|
|
|
It "Should read with pwd" {
|
|
$actual = Import-Excel -Path "$pwd\testRelative.xlsx"
|
|
$actual | Should Not Be $null
|
|
}
|
|
|
|
It "Should read with PSScriptRoot" {
|
|
$actual = Import-Excel -Path "$PSScriptRoot\testRelative.xlsx"
|
|
$actual | Should Not Be $null
|
|
}
|
|
|
|
It "Should read with just a file name and resolve to cwd" {
|
|
$actual = Import-Excel -Path "testRelative.xlsx"
|
|
$actual | Should Not Be $null
|
|
}
|
|
|
|
It "Should fail for not found" {
|
|
{ Import-Excel -Path "ExcelFileDoesNotExist.xlsx" } | Should Throw "'ExcelFileDoesNotExist.xlsx' file not found"
|
|
}
|
|
} |