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

Import RDoc 3.5.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-02-02 00:32:30 +00:00
parent 918f625a5e
commit cc2a16d94d
49 changed files with 2119 additions and 273 deletions

View file

@ -30,6 +30,34 @@ class TestRDocCodeObject < XrefTestCase
assert_equal 'I am a comment', @co.comment
end
def test_comment_equals_encoding
skip "Encoding not implemented" unless Object.const_defined? :Encoding
refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
input = 'text'
input.force_encoding Encoding::UTF_8
@co.comment = input
assert_equal 'text', @co.comment
assert_equal Encoding::UTF_8, @co.comment.encoding
end
def test_comment_equals_encoding_blank
skip "Encoding not implemented" unless Object.const_defined? :Encoding
refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
input = ''
input.force_encoding Encoding::UTF_8
@co.comment = input
assert_equal '', @co.comment
assert_equal Encoding::UTF_8, @co.comment.encoding
end
def test_document_children_equals
@co.document_children = false
refute @co.document_children
@ -101,6 +129,12 @@ class TestRDocCodeObject < XrefTestCase
assert_nil @co.instance_variable_get(:@full_name)
end
def test_line
@c1_m.line = 5
assert_equal 5, @c1_m.line
end
def test_metadata
assert_empty @co.metadata
@ -113,6 +147,12 @@ class TestRDocCodeObject < XrefTestCase
assert_equal 'not_rdoc', @co.metadata['markup']
end
def test_offset
@c1_m.offset = 5
assert_equal 5, @c1_m.offset
end
def test_parent_file_name
assert_equal '(unknown)', @co.parent_file_name
assert_equal 'xref_data.rb', @c1.parent_file_name