mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-14 15:23:15 +00:00
create xlsx before all in cwd
This commit is contained in:
@@ -1,22 +1,31 @@
|
|||||||
Describe "Test reading relative paths" {
|
Describe "Test reading relative paths" {
|
||||||
|
BeforeAll {
|
||||||
|
$script:xlfileName = "TestR.xlsx"
|
||||||
|
@{data = 1 } | Export-Excel "$pwd\TestR.xlsx"
|
||||||
|
}
|
||||||
|
|
||||||
|
AfterAll {
|
||||||
|
Remove-Item "$pwd\$($script:xlfileName)"
|
||||||
|
}
|
||||||
|
|
||||||
It "Should read local file" {
|
It "Should read local file" {
|
||||||
$actual = Import-Excel -Path ".\testRelative.xlsx"
|
$actual = Import-Excel -Path ".\$($script:xlfileName)"
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
$actual.Count | Should Not Be 1
|
$actual.Count | Should Be 1
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should read with pwd" {
|
It "Should read with pwd" {
|
||||||
$actual = Import-Excel -Path "$pwd\testRelative.xlsx"
|
$actual = Import-Excel -Path "$pwd\$($script:xlfileName)"
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should read with PSScriptRoot" {
|
It "Should read with PSScriptRoot" {
|
||||||
$actual = Import-Excel -Path "$PSScriptRoot\testRelative.xlsx"
|
$actual = Import-Excel -Path "$PSScriptRoot\$($script:xlfileName)"
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should read with just a file name and resolve to cwd" {
|
It "Should read with just a file name and resolve to cwd" {
|
||||||
$actual = Import-Excel -Path "testRelative.xlsx"
|
$actual = Import-Excel -Path "$($script:xlfileName)"
|
||||||
$actual | Should Not Be $null
|
$actual | Should Not Be $null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user