@@ -101,6 +101,7 @@ def test_do_attr_rb_attr
101101 assert_equal 'accessor' , accessor . name
102102 assert_equal 'RW' , accessor . rw
103103 assert_equal 'This is an accessor' , accessor . comment
104+ assert_equal @top_level , accessor . file
104105
105106 reader = attrs . shift
106107 assert_equal 'reader' , reader . name
@@ -134,6 +135,7 @@ def test_do_attr_rb_define_attr
134135 assert_equal 'accessor' , accessor . name
135136 assert_equal 'RW' , accessor . rw
136137 assert_equal 'This is an accessor' , accessor . comment
138+ assert_equal @top_level , accessor . file
137139 end
138140
139141 def test_do_aliases
@@ -159,6 +161,9 @@ def test_do_aliases
159161 assert_equal 2 , methods . length
160162 assert_equal 'bleh' , methods . last . name
161163 assert_equal 'blah' , methods . last . is_alias_for . name
164+
165+ assert_equal @top_level , methods . last . is_alias_for . file
166+ assert_equal @top_level , methods . last . file
162167 end
163168
164169 def test_do_aliases_singleton
@@ -339,6 +344,8 @@ def test_do_constants
339344 constants = klass . constants
340345 assert !klass . constants . empty?
341346
347+ assert_equal @top_level , constants . first . file
348+
342349 constants = constants . map { |c | [ c . name , c . value , c . comment ] }
343350
344351 assert_equal [ 'PERFECT' , '300' , 'The highest possible score in bowling ' ] ,
@@ -754,6 +761,7 @@ def test_handle_method
754761 equals2 = bo . method_list . first
755762
756763 assert_equal '==' , equals2 . name
764+ assert_equal @top_level , equals2 . file
757765 end
758766
759767 def test_handle_method_initialize
0 commit comments