diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
commit | 2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch) | |
tree | ee99486567461dd5796f3d6edcc9e204187f2666 /test/rdoc/test_rdoc_attr.rb | |
parent | d7effd506f5b91a636f2e6452ef1946b923007c7 (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_attr.rb')
-rw-r--r-- | test/rdoc/test_rdoc_attr.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/test/rdoc/test_rdoc_attr.rb b/test/rdoc/test_rdoc_attr.rb index 10965d00b6..9751cc175d 100644 --- a/test/rdoc/test_rdoc_attr.rb +++ b/test/rdoc/test_rdoc_attr.rb @@ -8,6 +8,12 @@ class TestRDocAttr < MiniTest::Unit::TestCase @a = RDoc::Attr.new nil, 'attr', 'RW', '' end + def test_aref + m = RDoc::Attr.new nil, 'attr', 'RW', nil + + assert_equal 'attribute-i-attr', m.aref + end + def test_arglists assert_nil @a.arglists end @@ -20,6 +26,18 @@ class TestRDocAttr < MiniTest::Unit::TestCase assert_nil @a.call_seq end + def test_definition + assert_equal 'attr_accessor', @a.definition + + @a.rw = 'R' + + assert_equal 'attr_reader', @a.definition + + @a.rw = 'W' + + assert_equal 'attr_writer', @a.definition + end + def test_full_name assert_equal '(unknown)#attr', @a.full_name end @@ -33,15 +51,10 @@ class TestRDocAttr < MiniTest::Unit::TestCase end def test_type - assert_equal 'attr_accessor', @a.type - - @a.rw = 'R' - - assert_equal 'attr_reader', @a.type - - @a.rw = 'W' + assert_equal 'instance', @a.type - assert_equal 'attr_writer', @a.type + @a.singleton = true + assert_equal 'class', @a.type end end |