|
5 | 5 | class TestCommands < Minitest::Test
|
6 | 6 | def test_basic
|
7 | 7 | out = make_bin("strong.md")
|
| 8 | + |
8 | 9 | assert_equal("<p>I am <strong>strong</strong></p>", out)
|
9 | 10 | end
|
10 | 11 |
|
11 | 12 | def test_does_not_have_extensions
|
12 | 13 | out = make_bin("table.md")
|
| 14 | + |
13 | 15 | assert_includes(out, "| a")
|
14 | 16 | refute_includes(out, "<p><del>hi</del>")
|
15 | 17 | refute_includes(out, "<table> <tr> <th> a </th> <td> c </td>")
|
16 | 18 | end
|
17 | 19 |
|
18 | 20 | def test_understands_extensions
|
19 | 21 | out = make_bin("table.md", "--extension=table")
|
| 22 | + |
20 | 23 | refute_includes(out, "| a")
|
21 | 24 | refute_includes(out, "<p><del>hi</del>")
|
22 | 25 | ["<table>", "<tr>", "<th>", "a", "</th>", "<td>", "c", "</td>"].each { |html| assert_includes(out, html) }
|
23 | 26 | end
|
24 | 27 |
|
25 | 28 | def test_understands_multiple_extensions
|
26 | 29 | out = make_bin("table.md", "--extension=table,strikethrough")
|
| 30 | + |
27 | 31 | refute_includes(out, "| a")
|
28 | 32 | assert_includes(out, "<p><del>hi</del>")
|
29 | 33 | ["<table>", "<tr>", "<th>", "a", "</th>", "<td>", "c", "</td>"].each { |html| assert_includes(out, html) }
|
30 | 34 | end
|
31 | 35 |
|
32 | 36 | def test_understands_html_format_with_renderer_and_extensions
|
33 | 37 | out = make_bin("table.md", "--to=html --extension=table,strikethrough --html-renderer")
|
| 38 | + |
34 | 39 | refute_includes(out, "| a")
|
35 | 40 | assert_includes(out, "<p><del>hi</del>")
|
36 | 41 | ["<table>", "<tr>", "<th>", "a", "</th>", "<td>", "c", "</td>"].each { |html| assert_includes(out, html) }
|
37 | 42 | end
|
38 | 43 |
|
39 | 44 | def test_understands_xml_format
|
40 | 45 | out = make_bin("strong.md", "--to=xml")
|
| 46 | + |
41 | 47 | assert_includes(out, '<?xml version="1.0" encoding="UTF-8"?>')
|
42 | 48 | assert_includes(out, '<text xml:space="preserve">strong</text>')
|
43 | 49 | end
|
44 | 50 |
|
45 | 51 | def test_understands_commonmark_format
|
46 | 52 | out = make_bin("strong.md", "--to=commonmark")
|
| 53 | + |
47 | 54 | assert_equal("I am **strong**", out)
|
48 | 55 | end
|
49 | 56 |
|
50 | 57 | def test_understands_plaintext_format
|
51 | 58 | out = make_bin("strong.md", "--to=plaintext")
|
| 59 | + |
52 | 60 | assert_equal("I am strong", out)
|
53 | 61 | end
|
54 | 62 |
|
|
0 commit comments