Merge pull request #1532 from waldyr/master

Remove exclamation point from non found method
This commit is contained in:
Kyrylo Silin 2016-04-02 19:32:13 +03:00
commit f5c97cac10
2 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,7 @@ class Pry
end
def no_definition_message
"Couldn't locate a definition for #{obj_name}!"
"Couldn't locate a definition for #{obj_name}"
end
# Generate a header (meta-data information) for all the code

View File

@ -71,6 +71,13 @@ describe "show-source" do
expect(mock_pry(binding, "show-source _c#wrongmethod")).to match(/Couldn't locate/)
end
it "should not show the source and deliver an error message without exclamation point" do
_c = Class.new
error_message = "Error: Couldn't locate a definition for _c#wrongmethod\n"
expect(mock_pry(binding, "show-source _c#wrongmethod")).to eq(error_message)
end
it "should find instance_methods if the class overrides instance_method" do
_c = Class.new{
def method;