summaryrefslogtreecommitdiff
path: root/jni/ruby/test/rdoc/test_rdoc_generator_markup.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/rdoc/test_rdoc_generator_markup.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/rdoc/test_rdoc_generator_markup.rb')
-rw-r--r--jni/ruby/test/rdoc/test_rdoc_generator_markup.rb59
1 files changed, 59 insertions, 0 deletions
diff --git a/jni/ruby/test/rdoc/test_rdoc_generator_markup.rb b/jni/ruby/test/rdoc/test_rdoc_generator_markup.rb
new file mode 100644
index 0000000..5f8a45b
--- /dev/null
+++ b/jni/ruby/test/rdoc/test_rdoc_generator_markup.rb
@@ -0,0 +1,59 @@
+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'
+
+ 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
+