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.
|
||||
#
|
||||
def recurse_namespace(klass, done={}, &block)
|
||||
if done[klass] || !(Module === klass)
|
||||
return
|
||||
end
|
||||
return if !(Module === klass) || done[klass]
|
||||
|
||||
done[klass] = true
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue