diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
commit | 23863ff75d3ec9205d5f365b98b6608e38a93749 (patch) | |
tree | 362b9fc870edb3820ef488a6618baf5669d3aa48 /test/rdoc/test_rdoc_context_section.rb | |
parent | 0d715e1b7540e1c876a4c53862355d5c43dd8683 (diff) | |
download | ruby-23863ff75d3ec9205d5f365b98b6608e38a93749.tar.gz |
* lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513)
https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016--
https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_context_section.rb')
-rw-r--r-- | test/rdoc/test_rdoc_context_section.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_context_section.rb b/test/rdoc/test_rdoc_context_section.rb index bd82d191b6..b008c60c57 100644 --- a/test/rdoc/test_rdoc_context_section.rb +++ b/test/rdoc/test_rdoc_context_section.rb @@ -48,6 +48,22 @@ class TestRDocContextSection < RDoc::TestCase assert_equal 'one+two', @S.new(nil, 'one two', nil).aref end + def test_eql_eh + other = @S.new @klass, 'other', comment('# comment', @top_level) + + assert @s.eql? @s + assert @s.eql? @s.dup + refute @s.eql? other + end + + def test_equals + other = @S.new @klass, 'other', comment('# comment', @top_level) + + assert_equal @s, @s + assert_equal @s, @s.dup + refute_equal @s, other + end + def test_extract_comment assert_equal '', @s.extract_comment(comment('')).text assert_equal '', @s.extract_comment(comment("# :section: b\n")).text @@ -56,6 +72,14 @@ class TestRDocContextSection < RDoc::TestCase @s.extract_comment(comment("# a\n# :section: b\n# c")).text end + def test_hash + other = @S.new @klass, 'other', comment('# comment', @top_level) + + assert_equal @s.hash, @s.hash + assert_equal @s.hash, @s.dup.hash + refute_equal @s.hash, other.hash + end + def test_marshal_dump loaded = Marshal.load Marshal.dump @s |