зеркало из https://github.com/github/ruby.git
test_exception - fix with & w/o did_you_mean
See Ruby issue 16263
This commit is contained in:
Родитель
ca7de0334d
Коммит
9223466752
|
@ -995,15 +995,18 @@ end.join
|
|||
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче