rdoc 6.1.2.1 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rdoc might be problematic. Click here for more details.

@@ -1,115 +0,0 @@
1
- # frozen_string_literal: true
2
- ##
3
- # Test case for creating new plain-text RDoc::Markup formatters. See also
4
- # RDoc::Markup::FormatterTestCase
5
- #
6
- # See test_rdoc_markup_to_rdoc.rb for a complete example.
7
- #
8
- # Example:
9
- #
10
- # class TestRDocMarkupToNewTextFormat < RDoc::Markup::TextFormatterTestCase
11
- #
12
- # add_visitor_tests
13
- # add_text_tests
14
- #
15
- # def setup
16
- # super
17
- #
18
- # @to = RDoc::Markup::ToNewTextFormat.new
19
- # end
20
- #
21
- # def accept_blank_line
22
- # assert_equal :junk, @to.res.join
23
- # end
24
- #
25
- # # ...
26
- #
27
- # end
28
-
29
- class RDoc::Markup::TextFormatterTestCase < RDoc::Markup::FormatterTestCase
30
-
31
- ##
32
- # Adds test cases to the calling TestCase.
33
-
34
- def self.add_text_tests
35
- self.class_eval do
36
-
37
- ##
38
- # Test case that calls <tt>@to.accept_heading</tt>
39
-
40
- def test_accept_heading_indent
41
- @to.start_accepting
42
- @to.indent = 3
43
- @to.accept_heading @RM::Heading.new(1, 'Hello')
44
-
45
- accept_heading_indent
46
- end
47
-
48
- ##
49
- # Test case that calls <tt>@to.accept_rule</tt>
50
-
51
- def test_accept_rule_indent
52
- @to.start_accepting
53
- @to.indent = 3
54
- @to.accept_rule @RM::Rule.new(1)
55
-
56
- accept_rule_indent
57
- end
58
-
59
- ##
60
- # Test case that calls <tt>@to.accept_verbatim</tt>
61
-
62
- def test_accept_verbatim_indent
63
- @to.start_accepting
64
- @to.indent = 2
65
- @to.accept_verbatim @RM::Verbatim.new("hi\n", " world\n")
66
-
67
- accept_verbatim_indent
68
- end
69
-
70
- ##
71
- # Test case that calls <tt>@to.accept_verbatim</tt> with a big indent
72
-
73
- def test_accept_verbatim_big_indent
74
- @to.start_accepting
75
- @to.indent = 2
76
- @to.accept_verbatim @RM::Verbatim.new("hi\n", "world\n")
77
-
78
- accept_verbatim_big_indent
79
- end
80
-
81
- ##
82
- # Test case that calls <tt>@to.accept_paragraph</tt> with an indent
83
-
84
- def test_accept_paragraph_indent
85
- @to.start_accepting
86
- @to.indent = 3
87
- @to.accept_paragraph @RM::Paragraph.new(('words ' * 30).strip)
88
-
89
- accept_paragraph_indent
90
- end
91
-
92
- ##
93
- # Test case that calls <tt>@to.accept_paragraph</tt> with a long line
94
-
95
- def test_accept_paragraph_wrap
96
- @to.start_accepting
97
- @to.accept_paragraph @RM::Paragraph.new(('words ' * 30).strip)
98
-
99
- accept_paragraph_wrap
100
- end
101
-
102
- ##
103
- # Test case that calls <tt>@to.attributes</tt> with an escaped
104
- # cross-reference. If this test doesn't pass something may be very
105
- # wrong.
106
-
107
- def test_attributes
108
- assert_equal 'Dog', @to.attributes("\\Dog")
109
- end
110
-
111
- end
112
- end
113
-
114
- end
115
-