diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-31 01:22:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-31 01:22:51 +0000 |
commit | ce7f8287e29fb3f87d74c883d04a30754103e11e (patch) | |
tree | bfdc22e89ff99cb92099f7600189268b78a77fc2 /test/ruby/test_exception.rb | |
parent | 9d64a542094efdbcf8fc8b192750d6b0343665c3 (diff) | |
download | ruby-ce7f8287e29fb3f87d74c883d04a30754103e11e.tar.gz |
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
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index f8ddd9d3fa..d0ed477916 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -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 |