Permalink
Browse files

Merge pull request #14 from Iristyle/master

Bugfixed test file output
  • Loading branch information...
2 parents 755269f + c2f0aae commit fa862c41182b19c5498ae255420bfbc54b4d7668 @scottmuc scottmuc committed Oct 25, 2011
Showing with 7 additions and 5 deletions.
  1. +7 −5 Functions/It.ps1
View
@@ -16,14 +16,14 @@ function It($name, [ScriptBlock] $test)
Start-PesterConsoleTranscript
try{
temp
- $output | Write-Host -ForegroundColor green;
+ "[+] $output " | Write-Host -ForegroundColor green;
} catch {
$failure_message = $_.toString() -replace "Exception calling", "Assert failed on"
$temp_line_number = $_.InvocationInfo.ScriptLineNumber - 2
$failure_line_number = $start_line_position + $temp_line_number
$results.FailedTests += $name
- $output | Write-Host -ForegroundColor red
+ "[-] $output" | Write-Host -ForegroundColor red
Write-Host -ForegroundColor red $error_margin$failure_message
Write-Host -ForegroundColor red $error_margin$error_margin"at line: $failure_line_number in $test_file"
@@ -48,7 +48,9 @@ function Get-ConsoleText {
}
function Setup-TestFunction {
- "function temp {" | out-file $TestDrive\temp.ps1
- $test | out-file -append $TestDrive\temp.ps1
- "}" | out-file -append $TestDrive\temp.ps1
+@"
+function temp {
+$test
+}
+"@ | out-file $TestDrive\temp.ps1
}

0 comments on commit fa862c4

Please sign in to comment.