diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
commit | 1c279a7d2753949c725754e1302f791b76358114 (patch) | |
tree | 36aa3bdde250e564445eba5f2e25fcb96bcb6cef /test/rdoc/test_rdoc_generator_markup.rb | |
parent | c72f0daa877808e4fa5018b3191ca09d4b97c03d (diff) | |
download | ruby-1c279a7d2753949c725754e1302f791b76358114.tar.gz |
* lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc: ditto
* test/rdoc: ditto
* NEWS: Updated with RDoc 4.0 information
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_generator_markup.rb')
-rw-r--r-- | test/rdoc/test_rdoc_generator_markup.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_generator_markup.rb b/test/rdoc/test_rdoc_generator_markup.rb new file mode 100644 index 0000000000..1b44085283 --- /dev/null +++ b/test/rdoc/test_rdoc_generator_markup.rb @@ -0,0 +1,56 @@ +require 'rdoc/test_case' + +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' + + assert_equal "\n<h1 id=\"label-Hello\">Hello</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 + |