ruby-changes:58326
From: MSP-Greg <ko1@a...>
Date: Mon, 21 Oct 2019 09:11:48 +0900 (JST)
Subject: [ruby-changes:58326] 9223466752 (master): test_exception - fix with & w/o did_you_mean
https://git.ruby-lang.org/ruby.git/commit/?id=9223466752 From 92234667526dfb66cfeff0eab49fa3e7588ff73e Mon Sep 17 00:00:00 2001 From: MSP-Greg <MSP-Greg@u...> Date: Sat, 19 Oct 2019 17:23:18 -0500 Subject: test_exception - fix with & w/o did_you_mean See Ruby issue 16263 diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index e5c3809..7ced9a9 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -995,15 +995,18 @@ end.join https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L995 error = NoMethodError.new("Message", :foo) assert_raise(ArgumentError) {error.receiver} + msg = Object.const_defined?(:DidYouMean) ? + "Message\nDid you mean? for" : "Message" + error = NoMethodError.new("Message", :foo, receiver: receiver) - assert_equal(["Message", :foo, receiver], + assert_equal([msg, :foo, receiver], [error.message, error.name, error.receiver]) error = NoMethodError.new("Message", :foo, [1, 2]) assert_raise(ArgumentError) {error.receiver} error = NoMethodError.new("Message", :foo, [1, 2], receiver: receiver) - assert_equal(["Message", :foo, [1, 2], receiver], + assert_equal([msg, :foo, [1, 2], receiver], [error.message, error.name, error.args, error.receiver]) error = NoMethodError.new("Message", :foo, [1, 2], true) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/