File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -779,9 +779,8 @@ def find_class_method_named(name)
779779 # Finds a constant with +name+ in this context
780780
781781 def find_constant_named ( name )
782- @constants . find do |m |
783- m . name == name || m . full_name == name
784- end
782+ name = name [ 2 ..-1 ] if name . start_with? ( '::' )
783+ @constants . find { |m | m . name == name || m . full_name == name }
785784 end
786785
787786 ##
Original file line number Diff line number Diff line change @@ -524,6 +524,7 @@ def test_find_class_method_named
524524 def test_find_constant_named
525525 assert_nil @c1 . find_constant_named ( 'NONE' )
526526 assert_equal ':const' , @c1 . find_constant_named ( 'CONST' ) . value
527+ assert_equal ':const' , @c1 . find_constant_named ( '::CONST' ) . value
527528 end
528529
529530 def test_find_enclosing_module_named
You can’t perform that action at this time.
0 commit comments