aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2016-10-28 13:23:41 +0000
committerGravatar John Cater <jcater@google.com>2016-10-28 16:03:43 +0000
commitf04cbe39a07f7c34a742378b16dd47d9a2b6e476 (patch)
treeadb2301ec2a9af1e5893b4ac1547f25ed72bf7c1 /src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
parent6a2dc2b38b650014cd0b980fb18b171c6cc8e0ac (diff)
Small docs updates for the extra action rule.
Add the product name to the ConfiguredRuleClassProvider so that the doc generator can generate the proper links to the user manual. -- MOS_MIGRATED_REVID=137505460
Diffstat (limited to 'src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java b/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
index fbacd0c080..cea22dace2 100644
--- a/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
+++ b/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
@@ -36,8 +36,8 @@ public class RuleLinkExpanderTest {
.put("Fileset", "fileset")
.put("proto_library", "protocol-buffer")
.build();
- multiPageExpander = new RuleLinkExpander(index, false);
- singlePageExpander = new RuleLinkExpander(index, true);
+ multiPageExpander = new RuleLinkExpander("product-name", index, false);
+ singlePageExpander = new RuleLinkExpander("product-name", index, true);
}
private void checkExpandSingle(String docs, String expected) {
@@ -111,6 +111,15 @@ public class RuleLinkExpanderTest {
"<a href=\"#common-definitions\">Common Definitions</a>");
}
+ @Test public void testUserManualRefIncludesProductName() {
+ checkExpandMulti(
+ "<a href=\"${link user-manual#overview}\">Link</a>",
+ "<a href=\"product-name-user-manual.html#overview\">Link</a>");
+ checkExpandSingle(
+ "<a href=\"${link user-manual#overview}\">Link</a>",
+ "<a href=\"product-name-user-manual.html#overview\">Link</a>");
+ }
+
@Test(expected = IllegalArgumentException.class)
public void testRefNotFound() {
String docs = "<a href=\"${link foo.bar}\">bar</a>";