1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/rdoc/test_rdoc_generator_markup.rb
hsbt 98c7058bf7 Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing.

From: SHIBATA Hiroshi <hsbt@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 05:56:26 +00:00

60 lines
1.2 KiB
Ruby

# frozen_string_literal: true
require 'minitest_helper'
class TestRDocGeneratorMarkup < RDoc::TestCase
include RDoc::Text
include RDoc::Generator::Markup
attr_reader :store
def setup
super
@options = RDoc::Options.new
@rdoc.options = @options
@parent = self
@path = '/index.html'
@symbols = {}
end
def test_aref_to
assert_equal 'Foo/Bar.html', aref_to('Foo/Bar.html')
end
def test_as_href
assert_equal '../index.html', as_href('Foo/Bar.html')
end
def test_cvs_url
assert_equal 'http://example/this_page',
cvs_url('http://example/', 'this_page')
assert_equal 'http://example/?page=this_page&foo=bar',
cvs_url('http://example/?page=%s&foo=bar', 'this_page')
end
def test_description
@comment = '= Hello'
links = '<span><a href="#label-Hello">&para;</a> ' +
'<a href="#top">&uarr;</a></span>'
assert_equal "\n<h1 id=\"label-Hello\">Hello#{links}</h1>\n", description
end
def test_formatter
assert_kind_of RDoc::Markup::ToHtmlCrossref, formatter
refute formatter.show_hash
assert_same self, formatter.context
end
attr_reader :path
def find_symbol name
@symbols[name]
end
end