moved out of BeforeAll

This commit is contained in:
dfinke
2018-05-27 13:04:37 -04:00
parent 2683ec985f
commit ba06c4620f
2 changed files with 13 additions and 10 deletions

View File

@@ -1,9 +1,8 @@
# Get-Module -ListAvailable pester | Out-Host # Get-Module -ListAvailable pester | Out-Host
# return # return
# if ((Get-Module -ListAvailable pester) -eq $null) { if ((Get-Module -ListAvailable pester) -eq $null) {
# Install-Module -Name Pester -Repository PSGallery -Force Install-Module -Name Pester -Repository PSGallery -Force
# } }
Install-Module -Name Pester -Repository PSGallery -Force
Invoke-Pester -Script $PSScriptRoot\UnitTests Invoke-Pester -Script $PSScriptRoot\UnitTests

View File

@@ -1,12 +1,16 @@
Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 Import-Module $PSScriptRoot\..\..\ImportExcel.psd1
$data = $null
$timer = Measure-Command {
$data = Import-Excel $PSScriptRoot\Simple.xlsx
}
Describe "Tests" { Describe "Tests" {
BeforeAll { # BeforeAll {
$data = $null # $data = $null
$timer = Measure-Command { # $timer = Measure-Command {
$data = Import-Excel $PSScriptRoot\Simple.xlsx # $data = Import-Excel $PSScriptRoot\Simple.xlsx
} # }
} # }
It "Should have two items" { It "Should have two items" {
$data.count | Should be 2 $data.count | Should be 2