1
Googleで徹底的に検索していますが、答えを見つけることができないようです。=> Rubyの演算子
def test_raising_a_particular_error
result = nil
begin
# 'raise' and 'fail' are synonyms
raise MySpecialError, "My Message"
rescue MySpecialError => ex
result = :exception_handled
end
assert_equal :exception_handled, result
assert_equal "My Message", ex.message
end
ここでは、「MySpecialError」のようなものをキャッチして、それを 'ex'という名前の変数*に格納することを意味します。 – ndn
@ndn、説明をありがとうございました –