@@ -80,4 +80,70 @@ def test_bold
8080 end
8181 end
8282
83+ def test_monofont
84+ markup = <<MARKUP
85+
86+ Paragraph containing +monofont_word+.
87+
88+ >>>
89+ Block quote containing +monofont_word+.
90+
91+ - List item containing +monofont_word+.
92+
93+ = Heading containing +monofont_word+.
94+
95+ Paragraph containing <tt>monofont phrase</tt>.
96+
97+ >>>
98+ Block quote containing <tt>monofont phrase</tt>.
99+
100+ - List item containing <tt>monofont phrase</tt>.
101+
102+ = Heading containing <tt>monofont phrase</tt>.
103+
104+ Paragraph containing <code>monofont phrase</code>.
105+
106+ >>>
107+ Block quote containing <code>monofont phrase</code>.
108+
109+ - List item containing <code>monofont phrase</code>.
110+
111+ = Heading containing <code>monofont phrase</code>.
112+
113+ MARKUP
114+ Helper . run_rdoc ( __method__ , markup ) do |html_lines |
115+ monofont_word_lines = Helper . select_lines ( html_lines , '<code>monofont_word</code>' )
116+ # Check count of monofont words.
117+ # (Five, not four, b/c the heading generates two.)
118+ assert_equal ( 5 , monofont_word_lines . size )
119+ monofont_phrase_lines = Helper . select_lines ( html_lines , '<code>monofont phrase</code>' )
120+ # Check count of monofont phrases.
121+ # (Ten, not eight, b/c each heading generates two.)
122+ assert_equal ( 10 , monofont_phrase_lines . size )
123+ end
124+ end
125+
126+ def test_character_conversions
127+ convertible_characters = %w[ (c) (r) ... -- --- 'foo' "bar" ] . join ( ' ' )
128+
129+ markup = <<MARKUP
130+
131+ Paragraph containing #{ convertible_characters } .
132+
133+ >>>
134+ Block quote containing #{ convertible_characters } .
135+
136+ - List item containing #{ convertible_characters } .
137+
138+ = Heading containing #{ convertible_characters } .
139+
140+ MARKUP
141+ Helper . run_rdoc ( __method__ , markup ) do |html_lines |
142+ converted_character_lines = Helper . select_lines ( html_lines , '© ® … – — ‘foo’ “bar”' )
143+ # Check count of converted character lines.
144+ # (The heading line contains escapes, and so does not match.)
145+ assert_equal ( 4 , converted_character_lines . size )
146+ end
147+ end
148+
83149end
0 commit comments