Skip to content

Commit

Permalink
Creates empty implementation of the function under test
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Muc committed May 24, 2011
1 parent cf3c3c5 commit 652da3c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Create-Fixture.ps1
Expand Up @@ -32,7 +32,11 @@ if (-not (Test-Path $path)) {
& md $path | Out-Null
}

$template = "`$pwd = Split-Path -Parent `$MyInvocation.MyCommand.Path
$test_code = "function $name {
}"

$fixture_code = "`$pwd = Split-Path -Parent `$MyInvocation.MyCommand.Path
`$sut = (Split-Path -Leaf `$MyInvocation.MyCommand.Path).Replace(`".Tests.`", `".`")
. `"`$pwd\`$sut`"
. `"`$pwd\$rel_path_to_pester`"
Expand All @@ -44,5 +48,5 @@ Describe `"$name`" {
}
}"

Create-File "$path\$name.ps1"
Create-File "$path\$name.Tests.ps1" $template
Create-File "$path\$name.ps1" $test_code
Create-File "$path\$name.Tests.ps1" $fixture_code

0 comments on commit 652da3c

Please sign in to comment.