Skip to content

Commit

Permalink
update RobotRulesTest for capturing "line with space before colon get…
Browse files Browse the repository at this point in the history
…s ignored" bug.
  • Loading branch information
kngenie committed Mar 28, 2014
1 parent 9a72553 commit 8e70e37
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,32 @@ public void testEmptyDisallowHasNoEffect() throws Exception {
assertFalse(rr.blocksPathForUA("/", WB_UA));
}

/**
* optional white spaces before/after "{@code :}", before EOL.
* @throws Exception
*/
public void testLessSpaceExtraSpace() throws Exception {
final String testString =
"User-agent:* \n" +
"User-agent :* \n" +
"Disallow:/ \n";
load(testString);

assertTrue(rr.blocksPathForUA("/index.html", WB_UA));
}

/**
* white spaces are allowed at the beginning of the line, too.
* @throws Exception
*/
public void testExtraSpace2() throws Exception {
final String testString =
" User-agent: *\n" +
" Disallow:/\n";
load(testString);

assertTrue(rr.blocksPathForUA("/index.html", WB_UA));
}

public void testComments() throws Exception {
final String testString =
"# User-agent: *\n" +
Expand Down

0 comments on commit 8e70e37

Please sign in to comment.