eval_error.c: Fix a format of NameError#message

* eval_error.c (undef_mesg_for): fix typo.  Before this commit
  `ArgumentError: malformed format string - %$` was raised when
  `NameError#message` is called.  [ruby-core:71282] [Bug #11640]
  [Fix GH-1077]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-31 01:22:51 +00:00
parent 9d64a54209
commit ce7f8287e2
3 changed files with 20 additions and 1 deletions

View file

@ -721,4 +721,16 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
assert_raise(NameError) {a.instance_eval("foo")}
assert_raise(NoMethodError, bug10969) {a.public_send("bar", true)}
end
def test_message_of_name_error
begin
Module.new do
module_function :foo
end
rescue => e
error = e
end
assert_match /\Aundefined method `foo' for module `#<Module:.*>'\z/, error.message
end
end