2017-11-27 13:45:24 +03:00
|
|
|
# frozen_string_literal: true
|
2019-08-08 17:09:24 +03:00
|
|
|
require_relative 'helper'
|
2012-11-27 08:28:14 +04:00
|
|
|
|
|
|
|
class TestRDocMarkupHeading < RDoc::TestCase
|
|
|
|
|
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
|
|
|
@h = RDoc::Markup::Heading.new 1, 'Hello *Friend*!'
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_aref
|
2014-12-07 04:22:37 +03:00
|
|
|
assert_equal 'label-Hello+Friend-21', @h.aref
|
2012-11-27 08:28:14 +04:00
|
|
|
end
|
|
|
|
|
2013-09-19 03:33:36 +04:00
|
|
|
def test_label
|
2014-12-07 04:22:37 +03:00
|
|
|
assert_equal 'label-Hello+Friend-21', @h.label
|
|
|
|
assert_equal 'label-Hello+Friend-21', @h.label(nil)
|
2013-09-19 03:33:36 +04:00
|
|
|
|
|
|
|
context = RDoc::NormalClass.new 'Foo'
|
|
|
|
|
2014-12-07 04:22:37 +03:00
|
|
|
assert_equal 'class-Foo-label-Hello+Friend-21', @h.label(context)
|
2013-09-19 03:33:36 +04:00
|
|
|
end
|
|
|
|
|
2012-11-27 08:28:14 +04:00
|
|
|
def test_plain_html
|
|
|
|
assert_equal 'Hello <strong>Friend</strong>!', @h.plain_html
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|