1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.nuiton.jrst.bugs;
24
25 import java.io.File;
26
27 import org.apache.commons.io.FileUtils;
28 import org.junit.Assert;
29 import org.junit.Test;
30 import org.nuiton.jrst.JRST;
31 import org.nuiton.jrst.JRSTAbstractTest;
32
33
34
35
36
37
38
39
40
41
42 public class TitlesTest extends JRSTAbstractTest {
43
44
45
46
47
48
49 @Test
50 public void testNoSubtitle() throws Exception {
51 File in = new File("src/test/resources/bugs/testNoSubtitle.rst");
52 File out = File.createTempFile("jrst-RstToHtml2", ".html");
53
54 generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
55 }
56
57
58
59
60
61
62
63
64 @Test
65 public void testNoContentBetweenTitles() throws Exception {
66 File in = new File("src/test/resources/bugs/testNoContentSubtitles.rst");
67 File out = File.createTempFile("jrst-testNoContentSubtitles", ".html");
68
69 new JRSTTestGenerator(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME) {
70
71 @Override
72 public void assertJRST(File in, File out) throws Exception {
73 String content = FileUtils.readFileToString(out, JRST.UTF_8);
74 Assert.assertTrue(content.indexOf("<h2>Prérequis</h2>") > 0
75 || content.indexOf("<h2 class=\"title\">Prérequis</h2>") > 0);
76 }
77 };
78 }
79 }