1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Import RDoc 2.2.1 r185

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2008-09-25 02:43:03 +00:00
parent 00b4a3f9c4
commit 858362e761
54 changed files with 2893 additions and 2268 deletions

View file

@ -1,5 +1,6 @@
require "test/unit"
require "rdoc/markup/inline"
require "rdoc/markup/to_html_crossref"
class TestRDocMarkupAttributeManager < Test::Unit::TestCase
@ -201,24 +202,23 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
end
def test_special
# class names, variable names, file names, or instance variables
@am.add_special(/(
\b([A-Z]\w+(::\w+)*)
| \#\w+[!?=]?
| \b\w+([_\/\.]+\w+)+[!?=]?
)/x,
:CROSSREF)
@am.add_special(RDoc::Markup::ToHtmlCrossref::CROSSREF_REGEXP, :CROSSREF)
assert_equal(["cat"], @am.flow("cat"))
#
# The apostrophes in "cats'" and "dogs'" suppress the flagging of these
# words as potential cross-references, which is necessary for the unit
# tests. Unfortunately, the markup engine right now does not actually
# check whether a cross-reference is valid before flagging it.
#
assert_equal(["cats'"], @am.flow("cats'"))
assert_equal(["cat ", crossref("#fred"), " dog"].flatten,
@am.flow("cat #fred dog"))
assert_equal(["cats' ", crossref("#fred"), " dogs'"].flatten,
@am.flow("cats' #fred dogs'"))
assert_equal([crossref("#fred"), " dog"].flatten,
@am.flow("#fred dog"))
assert_equal([crossref("#fred"), " dogs'"].flatten,
@am.flow("#fred dogs'"))
assert_equal(["cat ", crossref("#fred")].flatten, @am.flow("cat #fred"))
assert_equal(["cats' ", crossref("#fred")].flatten, @am.flow("cats' #fred"))
end
end