Skip to content

Commit

Permalink
runtests.bat has exit code. Spiking out test data container
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Muc committed Jan 20, 2011
1 parent 6c72ebc commit 4984a3e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 5 deletions.
14 changes: 14 additions & 0 deletions Functions/TestResultData.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$pwd = Split-Path -Parent $MyInvocation.MyCommand.Path
. "$pwd\..\Pester.ps1"

Describe "Test-Report" {

It "keeps a record of all the fixture descriptions" {
$sut = Create-TestResultData

$sut.AddDescription("Description")

$sut.GetDescriptions().should.be("Description")
}
}

18 changes: 18 additions & 0 deletions Functions/TestResultData.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function Create-TestResultData()
{
return New-Module {

$description_data = @{}

function AddDescription($description) {
$description_data[$description] = @{}
}

function GetDescriptions() {
return [array] $description_data.keys
}

Export-ModuleMember -Variable * -Function *
} -asCustomObject
}

2 changes: 1 addition & 1 deletion Pester-Console.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $fixtures_path = Resolve-Path $relative_path
Write-Host Executing all tests in $fixtures_path

Get-ChildItem $fixtures_path -Recurse |
? { $_.Name -match ".Tests." } |
? { $_.Name -match "\.Tests\." } |
% { & $_.PSPath }

Write-TestReport
Expand Down
4 changes: 3 additions & 1 deletion Pester.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$pwd = Split-Path -Parent $MyInvocation.MyCommand.Path

Resolve-Path $pwd\Functions\*.ps1 | % { . $_.ProviderPath }
Resolve-Path $pwd\Functions\*.ps1 |
? { -not ($_.ProviderPath.Contains(".Tests.")) } |
% { . $_.ProviderPath }

5 changes: 5 additions & 0 deletions runtests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@PowerShell Set-ExecutionPolicy Unrestricted
@PowerShell -NonInteractive -NoProfile -Command ".\Pester-Console.ps1"

@echo off
exit /B %errorlevel%
3 changes: 0 additions & 3 deletions testexit.bat

This file was deleted.

0 comments on commit 4984a3e

Please sign in to comment.