diff --git a/Tests/Unit.Tests.ps1 b/Tests/Unit.Tests.ps1 index 3f91f90..3d2b475 100644 --- a/Tests/Unit.Tests.ps1 +++ b/Tests/Unit.Tests.ps1 @@ -61,8 +61,10 @@ Describe "Basic unit tests" -Tags Build { } it "SetScript()" { + pushd $projectRoot $monitor = [MonitoredScript]::New() - {$monitor.SetScript("$projectRoot\scratchfiles\example.ps1")} | Should Not Throw + {$monitor.SetScript(".\scratchfiles\example.ps1")} | Should Not Throw + popd } } diff --git a/psake.ps1 b/psake.ps1 index b51af94..cf732c6 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -33,7 +33,7 @@ Task Init { Task UnitTests -Depends Init { $lines 'Running quick unit tests to fail early if there is an error' - $TestResults = Invoke-Pester -Path $ProjectRoot\Tests\*unit* -PassThru -Tag Build -Show Failed + $TestResults = Invoke-Pester -Path $ProjectRoot\Tests\*unit* -PassThru -Tag Build if($TestResults.FailedCount -gt 0) { @@ -47,7 +47,7 @@ Task Test -Depends UnitTests { "`n`tSTATUS: Testing with PowerShell $PSVersion" # Gather test results. Store them in a variable and file - $TestResults = Invoke-Pester -Path $ProjectRoot\Tests -PassThru -OutputFormat NUnitXml -OutputFile "$ProjectRoot\$TestFile" -Tag Build -Show Failed + $TestResults = Invoke-Pester -Path $ProjectRoot\Tests -PassThru -OutputFormat NUnitXml -OutputFile "$ProjectRoot\$TestFile" -Tag Build # In Appveyor? Upload our tests! #Abstract this into a function? If($ENV:BHBuildSystem -eq 'AppVeyor')