2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2012-11-26 23:28:14 -05:00
|
|
|
require 'rdoc/test_case'
|
|
|
|
|
|
|
|
class TestRDocMarkupHeading < RDoc::TestCase
|
|
|
|
|
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
|
|
|
@h = RDoc::Markup::Heading.new 1, 'Hello *Friend*!'
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_aref
|
2014-12-06 20:22:37 -05:00
|
|
|
assert_equal 'label-Hello+Friend-21', @h.aref
|
2012-11-26 23:28:14 -05:00
|
|
|
end
|
|
|
|
|
2013-09-18 19:33:36 -04:00
|
|
|
def test_label
|
2014-12-06 20:22:37 -05:00
|
|
|
assert_equal 'label-Hello+Friend-21', @h.label
|
|
|
|
assert_equal 'label-Hello+Friend-21', @h.label(nil)
|
2013-09-18 19:33:36 -04:00
|
|
|
|
|
|
|
context = RDoc::NormalClass.new 'Foo'
|
|
|
|
|
2014-12-06 20:22:37 -05:00
|
|
|
assert_equal 'class-Foo-label-Hello+Friend-21', @h.label(context)
|
2013-09-18 19:33:36 -04:00
|
|
|
end
|
|
|
|
|
2012-11-26 23:28:14 -05:00
|
|
|
def test_plain_html
|
|
|
|
assert_equal 'Hello <strong>Friend</strong>!', @h.plain_html
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|