Project

General

Profile

Bug #11640

[PATHC] Sometime `NameError#message` raises `ArgumentError: malformed format string - %$`

Added by yui-knk (Kaneko Yuichiro) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-10-30 trunk 52371) [x86_64-darwin14]
[ruby-core:71282]

Description

  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

# =>

TestException#test_name_error:
ArgumentError: malformed format string - %$
    /Users/yuichirokaneko/ruby/ruby/test/ruby/test_exception.rb:734:in `to_str'
    /Users/yuichirokaneko/ruby/ruby/test/ruby/test_exception.rb:734:in `to_s'
    /Users/yuichirokaneko/ruby/ruby/test/ruby/test_exception.rb:734:in `message'
    /Users/yuichirokaneko/ruby/ruby/test/ruby/test_exception.rb:734:in `test_name_error'

I send PR.

Associated revisions

Revision ce7f8287
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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

Revision 52400
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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]

Revision 52400
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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]

Revision 52400
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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]

Revision 52400
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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]

Revision 52400
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

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]

Revision 1c89b6bd
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 52403
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

Revision 52403
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

Revision 52403
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

Revision 52403
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

Revision 52403
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

test_exception.rb: get rid of did_you_mean

  • test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640]

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Status changed from Open to Closed

Applied in changeset r52400.


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]

Also available in: Atom PDF