lib/kitchen/verifier/pester.rb in kitchen-pester-0.12.1 vs lib/kitchen/verifier/pester.rb in kitchen-pester-0.12.2

- old
+ new

@@ -134,12 +134,12 @@ # private def run_command_script <<-CMD Import-Module -Name Pester -Force - $TestPath = "#{config[:root_path]}" - $OutputFilePath = Join-Path $TestPath -ChildPath 'PesterTestResults.xml' + $TestPath = Join-Path "#{config[:root_path]}" -ChildPath "suites" + $OutputFilePath = Join-Path "#{config[:root_path]}" -ChildPath 'PesterTestResults.xml' $options = New-PesterOption -TestSuiteName "Pester - #{instance.to_str}" $result = Invoke-Pester -Script $TestPath -OutputFile $OutputFilePath -OutputFormat NUnitXml -PesterOption $options -PassThru $result | Export-CliXml -Path (Join-Path -Path $TestPath -ChildPath 'result.xml') @@ -163,11 +163,11 @@ catch { $_ | Out-String | Write-Warning } $global:ProgressPreference = 'SilentlyContinue' - $env:PSModulePath = "$(Join-Path (Get-Item -Path $env:TEMP).FullName -ChildPath 'verifier/modules');$env:PSModulePath" + $env:PSModulePath = "$(Join-Path "#{config[:root_path]}" -ChildPath 'modules');$env:PSModulePath" #{script} EOH end @@ -194,12 +194,12 @@ param($Name) @(Get-Module -Name $Name -ListAvailable -ErrorAction SilentlyContinue).Count -gt 0 } - $VerifierModulePath = Confirm-Directory -Path $env:TEMP/verifier/modules - $VerifierTestsPath = Confirm-Directory -Path $env:TEMP/verifier/pester + $VerifierModulePath = Confirm-Directory -Path (Join-Path #{config[:root_path]} -ChildPath 'modules') + $VerifierDownloadPath = Confirm-Directory -Path (Join-Path #{config[:root_path]} -ChildPath 'pester') $env:PSModulePath = "$VerifierModulePath;$PSModulePath" if (-not (Test-Module -Name Pester)) { if (Test-Module -Name PowerShellGet) { @@ -239,19 +239,12 @@ Install-Module -Name Pester -Force } catch { Write-Host "Installing from Github" - $downloadFolder = if (Test-Path "$env:TEMP/PesterDownload") { - "$env:TEMP/PesterDownload" - } - else { - New-Item -ItemType Directory -Path "$env:TEMP/PesterDownload" - } + $zipFile = Join-Path (Get-Item -Path $VerifierDownloadPath).FullName -ChildPath "pester.zip" - $zipFile = Join-Path (Get-Item -Path $downloadFolder).FullName -ChildPath "pester.zip" - if (-not (Test-Path $zipfile)) { $source = 'https://github.com/pester/Pester/archive/4.10.1.zip' $webClient = New-Object -TypeName Net.WebClient if ($env:HTTP_PROXY) { @@ -346,10 +339,10 @@ File.directory?(f) end end def sandboxify_path(path) - File.join(sandbox_path, path.sub(%r{#{suite_test_folder}/}i, "")) + File.join(sandbox_path, "suites", path.sub(%r{#{suite_test_folder}/}i, "")) end # Returns an Array of common helper filenames currently residing on the # local workstation. #