1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Only try to Hash modules [Fixes #576]

This commit is contained in:
Conrad Irwin 2012-05-19 23:18:15 -07:00
parent a2f2315e49
commit eb5b8eb8ee
2 changed files with 10 additions and 4 deletions

View file

@ -90,9 +90,7 @@ class Pry
# @yieldparam klazz Each class/module in the namespace.
#
def recurse_namespace(klass, done={}, &block)
if done[klass] || !(Module === klass)
return
end
return if !(Module === klass) || done[klass]
done[klass] = true

View file

@ -35,7 +35,15 @@ unless Pry::Helpers::BaseHelpers.mri_18?
mock_pry("find-method timothy MyKlass").should.not =~ /MyKlass.*?goodbye/m
end
end
it "should work with badly behaved constants" do
MyKlass::X = Object.new
def (MyKlass::X).hash
raise "mooo"
end
mock_pry("find-method -c timothy MyKlass").should =~ /MyKlass.*?hello/m
end
end
Object.remove_const(:MyKlass)