Added resolve-path and tests. #627; Commented out write-warning

This commit is contained in:
dfinke
2019-07-04 11:18:28 -04:00
parent 142c31ccc1
commit 4581c2b3e9
3 changed files with 52 additions and 29 deletions

View File

@@ -0,0 +1,22 @@
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
}
}