Skip to content

Commit

Permalink
Add ContainMultiline and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed May 19, 2016
1 parent bf45595 commit c14aaae
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Functions/Assertions/ContainMultiline.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Set-StrictMode -Version Latest

InModuleScope Pester {
Describe "PesterContainMultiline" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1`nthis is line 2`nPester is awesome"
It "returns true if the file matches the specified content on one line" {
"$TestDrive\test.txt" | Should ContainMultiline "Pester"
}

It "returns true if the file matches the specified content across multiple lines" {
"$TestDrive\test.txt" | Should ContainMultiline "line 2`nPester"
}

It "returns false if the file does not contain the specified content" {
"$TestDrive\test.txt" | Should Not ContainMultiline "Pastor"
}
}
}
}

0 comments on commit c14aaae

Please sign in to comment.