@@ -364,6 +364,10 @@ def test_equals2
364364 refute_equal @c2_c3 , @c3
365365 end
366366
367+ def test_each_method_enumerator
368+ assert_kind_of Enumerator , @c1 . each_method
369+ end
370+
367371 def test_each_section
368372 sects = [ ]
369373 consts = [ ]
@@ -392,6 +396,10 @@ def test_each_section
392396 assert_equal expected_attrs , attrs
393397 end
394398
399+ def test_each_section_enumerator
400+ assert_kind_of Enumerator , @c1 . each_section
401+ end
402+
395403 def test_find_attribute_named
396404 assert_equal nil , @c1 . find_attribute_named ( 'none' )
397405 assert_equal 'R' , @c1 . find_attribute_named ( 'attr' ) . rw
@@ -667,6 +675,43 @@ def test_remove_invisible_in_public_force
667675 assert_equal [ @pub , @prot , @priv ] , methods
668676 end
669677
678+ def test_section_contents
679+ default = @context . sections . first
680+ @context . add_method RDoc ::AnyMethod . new ( nil , 'm1' )
681+
682+ b = @context . add_section 'B'
683+ m = @context . add_method RDoc ::AnyMethod . new ( nil , 'm2' )
684+ m . section = b
685+
686+ assert_equal [ default , b ] , @context . section_contents
687+ end
688+
689+ def test_section_contents_no_default
690+ @context = RDoc ::Context . new
691+ b = @context . add_section 'B'
692+ m = @context . add_method RDoc ::AnyMethod . new ( nil , 'm' )
693+ m . section = b
694+
695+ assert_equal [ b ] , @context . section_contents
696+ end
697+
698+ def test_section_contents_only_default
699+ @context = RDoc ::Context . new
700+
701+ @context . add_method RDoc ::AnyMethod . new ( nil , 'm' )
702+
703+ assert_empty @context . section_contents
704+ end
705+
706+ def test_section_contents_unused
707+ @context = RDoc ::Context . new
708+
709+ @context . add_method RDoc ::AnyMethod . new ( nil , 'm' )
710+ b = @context . add_section 'B'
711+
712+ assert_empty @context . section_contents
713+ end
714+
670715 def test_set_current_section
671716 default_section = @context . sections . first
672717
0 commit comments