Skip to content

Instantly share code, notes, and snippets.

@stej
Created January 13, 2012 15:41

Revisions

  1. stej created this gist Jan 13, 2012.
    22 changes: 22 additions & 0 deletions psaint.jaykul.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # how should I setup $filePath so that the assert (or act) block can see it?

    $root = split-path $MyInvocation.MyCommand.Path
    . "$root\..\..\..\..\..\Lib\PSaint\init.ps1"
    ipmo "$root\..\InstallerPackage.psm1" -DisableNameChecking -Force

    $FilePath = "$root\FileList.nsi"

    setup {
    # or here
    # $FilePath = "$root\FileList.nsi"
    }

    test "Assert file" {
    act {
    Write-Host Reading file $filePath
    $content = get-content $filePath -EA stop
    }
    assert {
    Assert-That { $content.Length -gt 0 }
    }
    }