Permalink
Browse files

succumbing to my OCD. fixing whitespace, and making long lines into m…

…ulti-line statements
  • Loading branch information...
1 parent 9eda852 commit ff747de27eaec23b8db1ac3ac573d7ad52c6e575 @scottmuc scottmuc committed Dec 29, 2012
Showing with 33 additions and 20 deletions.
  1. +4 −2 Build.bat
  2. +4 −4 Functions/Context.ps1
  3. +4 −5 Functions/Describe.ps1
  4. +3 −2 Functions/Setup.Tests.ps1
  5. +2 −2 Functions/Templating.ps1
  6. +2 −1 bin/pester.bat
  7. +14 −4 default.ps1
View
@@ -5,8 +5,10 @@ if '%1'=='-help' goto help
if '%1'=='-h' goto help
%~dp0vendor\tools\nuget.exe Install %~dp0vendor\packages.config -o %~dp0vendor\packages
-powershell -NoProfile -ExecutionPolicy Bypass -Command "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 %* -ScriptPath $psakeDir\tools ; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
+powershell -NoProfile -ExecutionPolicy Bypass -Command ^
+ "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 %* -ScriptPath $psakeDir\tools ; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
goto :eof
:help
-powershell -NoProfile -ExecutionPolicy Bypass -Command "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 -ScriptPath $psakeDir\tools -help"
+powershell -NoProfile -ExecutionPolicy Bypass -Command ^
+ "$psakeDir = ([array](dir %~dp0Vendor\packages\psake.*))[-1]; .$psakeDir\tools\psake.ps1 -ScriptPath $psakeDir\tools -help"
@@ -34,21 +34,21 @@ about_TestDrive
#>
param(
- $name,
+ $name,
[ScriptBlock] $fixture
)
Setup
$results = Get-GlobalTestResults
- $margin = " " * $results.TestDepth
+ $margin = " " * $results.TestDepth
$results.TestDepth += 1
- Write-Host -fore yellow $margin $name
+ Write-Host -fore yellow $margin $name
& $fixture
Cleanup
- $results.TestDepth -= 1
+ $results.TestDepth -= 1
}
@@ -51,26 +51,25 @@ about_TestDrive
#>
param(
- $name,
+ $name,
[ScriptBlock] $fixture
)
if($testName -ne '' -and $testName.ToLower() -ne $name.ToLower()) {return}
Setup
$results = Get-GlobalTestResults
- $margin = " " * $results.TestDepth
+ $margin = " " * $results.TestDepth
$results.TestDepth += 1
$results.CurrentDescribe = @{
name = $name
Tests = @()
}
-
- $output = $margin + "Describing " + $name
+ $output = $margin + "Describing " + $name
Write-Host -fore yellow $output
& $fixture
Cleanup
- $results.Describes += $results.CurrentDescribe
+ $results.Describes += $results.CurrentDescribe
$results.TestDepth -= 1
}
@@ -14,7 +14,7 @@ Describe "Setup" {
}
Describe "Create filesystem with directories" {
-
+
Setup -Dir "dir1"
Setup -Dir "dir2"
@@ -30,7 +30,7 @@ Describe "Create filesystem with directories" {
}
Describe "Create nested directory structure" {
-
+
Setup -Dir "parent/child"
It "creates parent directory" {
@@ -70,3 +70,4 @@ Describe "Create a file with content" {
$result.should.be("file contents")
}
}
+
@@ -12,12 +12,12 @@ function Get-Template($fileName) {
$path = '.\templates'
if($Global:ModulePath) {
$path = $global:ModulePath + '\templates'
- }
+ }
return Get-Content ("$path\$filename")
}
function Invoke-Template($templatName, $data) {
$template = Get-Template $templatName
$replacments = Get-ReplacementArgs $template $data
return Invoke-Expression "`$template $replacments"
-}
+}
View
@@ -31,7 +31,8 @@ echo Example: pester help about_Pester
goto finish
:help
-@PowerShell -NonInteractive -NoProfile -ExecutionPolicy unrestricted -Command "& Import-Module '%DIR%..\Pester.psm1'; & { Get-Help %2}"
+@PowerShell -NonInteractive -NoProfile -ExecutionPolicy unrestricted -Command ^
+ "& Import-Module '%DIR%..\Pester.psm1'; & { Get-Help %2}"
:finish
exit /B %errorlevel%
View
@@ -21,13 +21,19 @@ Task Test {
Task Version-Module{
$v = git describe --abbrev=0 --tags
$changeset=(git log -1 $($v + '..') --pretty=format:%H)
- (Get-Content "$baseDir\Pester.psm1") | % {$_ -replace "\`$version\`$", "$version" } | % {$_ -replace "\`$sha\`$", "$changeset" } | Set-Content "$baseDir\Pester.psm1"
+ (Get-Content "$baseDir\Pester.psm1") `
+ | % {$_ -replace "\`$version\`$", "$version" } `
+ | % {$_ -replace "\`$sha\`$", "$changeset" } `
+ | Set-Content "$baseDir\Pester.psm1"
}
Task Unversion-Module{
$v = git describe --abbrev=0 --tags
$changeset=(git log -1 $($v + '..') --pretty=format:%H)
- (Get-Content "$baseDir\Pester.psm1") | % {$_ -replace "$version", "`$version`$" } | % {$_ -replace "$changeset", "`$sha`$" } | Set-Content "$baseDir\Pester.psm1"
+ (Get-Content "$baseDir\Pester.psm1") `
+ | % {$_ -replace "$version", "`$version`$" } `
+ | % {$_ -replace "$changeset", "`$sha`$" } `
+ | Set-Content "$baseDir\Pester.psm1"
}
Task Pack-Nuget {
@@ -36,10 +42,14 @@ Task Pack-Nuget {
}
mkdir "$baseDir\build"
- exec { .$nugetExe pack "$baseDir\Pester.nuspec" -OutputDirectory "$baseDir\build" -NoPackageAnalysis -version $version }
+ exec {
+ . $nugetExe pack "$baseDir\Pester.nuspec" -OutputDirectory "$baseDir\build" `
+ -NoPackageAnalysis -version $version
+ }
}
Task Push-Nuget {
$pkg = Get-Item -path $baseDir\build\Pester.1.*.*.nupkg
exec { .$nugetExe push $pkg.FullName }
-}
+}
+

0 comments on commit ff747de

Please sign in to comment.