summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_code_object.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
commit2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch)
treeee99486567461dd5796f3d6edcc9e204187f2666 /test/rdoc/test_rdoc_code_object.rb
parentd7effd506f5b91a636f2e6452ef1946b923007c7 (diff)
Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_code_object.rb')
-rw-r--r--test/rdoc/test_rdoc_code_object.rb67
1 files changed, 62 insertions, 5 deletions
diff --git a/test/rdoc/test_rdoc_code_object.rb b/test/rdoc/test_rdoc_code_object.rb
index 907bb7a3d5..8ae2d8b91e 100644
--- a/test/rdoc/test_rdoc_code_object.rb
+++ b/test/rdoc/test_rdoc_code_object.rb
@@ -16,6 +16,7 @@ class TestRDocCodeObject < XrefTestCase
assert @co.document_children, 'document_children'
refute @co.force_documentation, 'force_documentation'
refute @co.done_documenting, 'done_documenting'
+ refute @co.received_nodoc, 'received_nodoc'
assert_equal '', @co.comment, 'comment is empty'
end
@@ -33,16 +34,20 @@ class TestRDocCodeObject < XrefTestCase
@co.document_children = false
refute @co.document_children
- @c2.document_children = false
- assert_empty @c2.classes
+ # TODO this is not true anymore:
+ # test all the nodoc stuff etc...
+ #@c2.document_children = false
+ #assert_empty @c2.classes
end
def test_document_self_equals
@co.document_self = false
refute @co.document_self
- @c1.document_self = false
- assert_empty @c1.method_list
+ # TODO this is not true anymore:
+ # test all the nodoc stuff etc...
+ #@c1.document_self = false
+ #assert_empty @c1.method_list
end
def test_documented_eh
@@ -56,11 +61,46 @@ class TestRDocCodeObject < XrefTestCase
refute @co.documented?
- @co.document_self = false
+ @co.document_self = nil # notify :nodoc:
assert @co.documented?
end
+ def test_done_documenting
+ # once done_documenting is set, other properties refuse to go to "true"
+ @co.done_documenting = true
+
+ @co.document_self = true
+ refute @co.document_self
+
+ @co.document_children = true
+ refute @co.document_children
+
+ @co.force_documentation = true
+ refute @co.force_documentation
+
+ @co.start_doc
+ refute @co.document_self
+ refute @co.document_children
+
+ # turning done_documenting on
+ # resets others to true
+
+ @co.done_documenting = false
+ assert @co.document_self
+ assert @co.document_children
+ end
+
+ def test_full_name_equals
+ @co.full_name = 'hi'
+
+ assert_equal 'hi', @co.instance_variable_get(:@full_name)
+
+ @co.full_name = nil
+
+ assert_nil @co.instance_variable_get(:@full_name)
+ end
+
def test_metadata
assert_empty @co.metadata
@@ -84,6 +124,23 @@ class TestRDocCodeObject < XrefTestCase
assert_equal 'C2', @c2_c3.parent_name
end
+ def test_received_ndoc
+ @co.document_self = false
+ refute @co.received_nodoc
+
+ @co.document_self = nil
+ assert @co.received_nodoc
+
+ @co.document_self = true
+ end
+
+ def test_record_location
+ c = RDoc::CodeObject.new
+ c.record_location @xref_data
+
+ assert_equal 'xref_data.rb', c.file.relative_name
+ end
+
def test_start_doc
@co.document_self = false
@co.document_children = false