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:
parent
a2f2315e49
commit
eb5b8eb8ee
2 changed files with 10 additions and 4 deletions
|
@ -90,9 +90,7 @@ class Pry
|
||||||
# @yieldparam klazz Each class/module in the namespace.
|
# @yieldparam klazz Each class/module in the namespace.
|
||||||
#
|
#
|
||||||
def recurse_namespace(klass, done={}, &block)
|
def recurse_namespace(klass, done={}, &block)
|
||||||
if done[klass] || !(Module === klass)
|
return if !(Module === klass) || done[klass]
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
done[klass] = true
|
done[klass] = true
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,14 @@ unless Pry::Helpers::BaseHelpers.mri_18?
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
Object.remove_const(:MyKlass)
|
Object.remove_const(:MyKlass)
|
||||||
|
|
Loading…
Add table
Reference in a new issue