summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-11 01:03:22 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-11 01:03:22 +0000
commit80325bab52091283f79c6ac6905609a640094833 (patch)
tree90b283b3bc1577f4589c219e85657f16683f9c72 /test
parent02dade3b9e0134190c6b0db1361d140fbeeb44f3 (diff)
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(21b241a)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb3
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb27
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb11
3 files changed, 41 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb
index 9fe4476229..34615aa625 100644
--- a/test/rdoc/test_rdoc_markup_attribute_manager.rb
+++ b/test/rdoc/test_rdoc_markup_attribute_manager.rb
@@ -130,6 +130,9 @@ class TestRDocMarkupAttributeManager < RDoc::TestCase
assert_equal(["cat ", @tt_on, "and", @tt_off, " dog"],
@am.flow("cat +and+ dog"))
+ assert_equal(["cat ", @tt_on, "X::Y", @tt_off, " dog"],
+ @am.flow("cat +X::Y+ dog"))
+
assert_equal(["cat ", @bold_on, "a_b_c", @bold_off, " dog"],
@am.flow("cat *a_b_c* dog"))
diff --git a/test/rdoc/test_rdoc_method_attr.rb b/test/rdoc/test_rdoc_method_attr.rb
index 0120ea6d9e..e93e81cee4 100644
--- a/test/rdoc/test_rdoc_method_attr.rb
+++ b/test/rdoc/test_rdoc_method_attr.rb
@@ -156,6 +156,33 @@ class TestRDocMethodAttr < XrefTestCase
refute_equal @c1_m, @parent_m
end
+ def test_pretty_print
+ temp_dir do |tmpdir|
+ s = RDoc::RI::Store.new tmpdir
+ s.rdoc = @rdoc
+
+ top_level = s.add_file 'file.rb'
+ meth_bang = RDoc::AnyMethod.new nil, 'method!'
+ meth_bang.record_location top_level
+
+ meth_bang_alias = RDoc::Alias.new nil, 'method!', 'method_bang', ''
+ meth_bang_alias.record_location top_level
+
+ klass = top_level.add_class RDoc::NormalClass, 'Object'
+ klass.add_method meth_bang
+
+ meth_bang.add_alias meth_bang_alias, klass
+
+ s.save
+
+ meth_alias_from_store = s.load_method 'Object', '#method_bang'
+
+ expected = "[RDoc::AnyMethod Object#method_bang public alias for method!]"
+ actual = mu_pp meth_alias_from_store
+ assert_equal expected, actual
+ end
+ end
+
def test_to_s
assert_equal 'RDoc::AnyMethod: C1#m', @c1_m.to_s
assert_equal 'RDoc::AnyMethod: C2#b', @c2_b.to_s
diff --git a/test/rdoc/test_rdoc_ruby_lex.rb b/test/rdoc/test_rdoc_ruby_lex.rb
index 22cf0f6295..8871b4f412 100644
--- a/test/rdoc/test_rdoc_ruby_lex.rb
+++ b/test/rdoc/test_rdoc_ruby_lex.rb
@@ -231,6 +231,17 @@ U
assert_equal expected, tokens
end
+ def test_class_tokenize_percent_w_quote
+ tokens = RDoc::RubyLex.tokenize '%w"hi"', nil
+
+ expected = [
+ @TK::TkDSTRING.new( 0, 1, 0, '%w"hi"'),
+ @TK::TkNL .new( 6, 1, 6, "\n"),
+ ]
+
+ assert_equal expected, tokens
+ end
+
def test_class_tokenize_regexp
tokens = RDoc::RubyLex.tokenize "/hay/", nil