77
88class RDiscountTest < Test ::Unit ::TestCase
99 def test_that_version_looks_valid
10- if not /^[0-9]+\. [0-9]+\. [0-9]+(\. [0-9]+)?$/ =~ RDiscount ::VERSION
10+ if not ( /^[0-9]+\. [0-9]+\. [0-9]+(\. [0-9]+)?$/ ) =~ RDiscount ::VERSION
1111 assert false , 'Expected RDiscount::VERSION to be a 3 or 4 component version string but found ' + RDiscount ::VERSION . to_s
1212 end
1313 end
@@ -139,12 +139,6 @@ def test_that_no_strikethrough_flag_works
139139 end
140140
141141 def test_that_tags_can_have_dashes_and_underscores
142- if RDiscount ::VERSION . start_with? "2.0.7"
143- # Skip test for 2.0.7.x series due to upstream behavioral change in
144- # Discount 2.0.7. This test can be fixed in Discount 2.1.5 using the
145- # WITH_GITHUB_TAGS compile-time flag.
146- return
147- end
148142 rd = RDiscount . new ( "foo <asdf-qwerty>bar</asdf-qwerty> and <a_b>baz</a_b>" )
149143 assert_equal "<p>foo <asdf-qwerty>bar</asdf-qwerty> and <a_b>baz</a_b></p>\n " , rd . to_html
150144 end
@@ -249,7 +243,18 @@ def test_that_discount_definition_lists_work
249243</dl>
250244EOS
251245 end
252-
246+
247+ def test_that_emphasis_beside_international_characters_detected
248+ rd = RDiscount . new ( %(*foo ä bar*) )
249+ assert_equal %(<p><em>foo ä bar</em></p>\n ) , rd . to_html
250+
251+ rd = RDiscount . new ( %(*ä foobar*) )
252+ assert_equal %(<p><em>ä foobar</em></p>\n ) , rd . to_html
253+
254+ rd = RDiscount . new ( %(*foobar ä*) )
255+ assert_equal %(<p><em>foobar ä</em></p>\n ) , rd . to_html
256+ end
257+
253258 def test_that_extra_definition_lists_work
254259 rd = RDiscount . new ( <<EOS )
255260tag1
@@ -262,15 +267,4 @@ def test_that_extra_definition_lists_work
262267</dl>
263268EOS
264269 end
265-
266- def test_that_emphasis_beside_international_characters_detected
267- rd = RDiscount . new ( %(*foo ä bar*) )
268- assert_equal %(<p><em>foo ä bar</em></p>\n ) , rd . to_html
269-
270- rd = RDiscount . new ( %(*ä foobar*) )
271- assert_equal %(<p><em>ä foobar</em></p>\n ) , rd . to_html
272-
273- rd = RDiscount . new ( %(*foobar ä*) )
274- assert_equal %(<p><em>foobar ä</em></p>\n ) , rd . to_html
275- end
276270end
0 commit comments