Permalink
Browse files

Catch empty section at end of test

  • Loading branch information...
1 parent 53e9743 commit b4a18c30ccd0643a5ab43c39d7a521250a2dda7a zoe slattery committed May 16, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/testcase/preconditions/rtHasNoEmptySections.php
View
12 src/testcase/preconditions/rtHasNoEmptySections.php
@@ -37,8 +37,8 @@ public function getMessage()
*/
public function isMet(array $testContents, array $sectionHeaders)
{
-
-
+ //TODO: This won't catch a section full of blank lines.
+ //It prabably should :-(
for ($i=0; $i<count($testContents) - 1; $i++) {
$nextLine = $testContents[$i+1];
$thisLine = $testContents[$i];
@@ -48,6 +48,14 @@ public function isMet(array $testContents, array $sectionHeaders)
}
}
}
+
+ //Catch an empty section at the end
+ if($this->isSectionHeading($thisLine)) {
+ if($nextLine == ""){
+ return false;
+ }
+ }
+
return true;
}
}

0 comments on commit b4a18c3

Please sign in to comment.