Skip to content

Commit 80e6d4c

Browse files
committed
Cleanup tests
1 parent 3187093 commit 80e6d4c

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

test/markdown_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def test_headings_with_trailing_space
138138
Dir["#{MARKDOWN_TEST_DIR}/Tests/*.text"].each do |text_file|
139139

140140
basename = File.basename(text_file).sub(/\.text$/, '')
141-
html_file = text_file.sub(/text$/, 'html')
142141
method_name = basename.gsub(/[-,()]/, '').gsub(/\s+/, '_').downcase
143142

144143
define_method "test_#{method_name}" do

test/rdiscount_test.rb

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class 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>
250244
EOS
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)
255260
tag1
@@ -262,15 +267,4 @@ def test_that_extra_definition_lists_work
262267
</dl>
263268
EOS
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
276270
end

0 commit comments

Comments
 (0)