aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_context_section.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_context_section.rb')
-rw-r--r--test/rdoc/test_rdoc_context_section.rb24
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