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

Remove reference to deleted helper [Fixes #359]

This commit is contained in:
Conrad Irwin 2011-12-03 19:03:31 -08:00
parent 561a8760c4
commit 13819b84db
2 changed files with 24 additions and 1 deletions

View file

@ -41,7 +41,7 @@ class Pry
if meth.super
meth = meth.super
else
command_error("The method '#{meth.name}' is not defined in a superclass of '#{class_name(meth.owner)}'.", omit_help)
command_error("'#{meth.name_with_owner}' has no super method.", omit_help)
end
end

View file

@ -316,6 +316,29 @@ describe "Pry::DefaultCommands::Introspection" do
str_output.string.should =~ /Mr flibble/
end
it "should find super methods" do
class Foo
def foo(*bars)
:super_wibble
end
end
o = Foo.new
Object.remove_const(:Foo)
def o.foo(*bars)
:wibble
end
mock_pry(binding, "show-method --super o.foo").should =~ /:super_wibble/
end
it "should not raise an exception when a non-extant super method is requested" do
o = Object.new
def o.foo(*bars); end
mock_pry(binding, "show-method --super o.foo").should =~ /'self.foo' has no super method/
end
# dynamically defined method source retrieval is only supported in
# 1.9 - where Method#source_location is native
if RUBY_VERSION =~ /1.9/