Я пытаюсь выучить ruby, используя код, скачанный с этого сайта .
Я застрял в этой точке.
def test_you_dont_get_null_pointer_errors_when_calling_methods_on_nil
# What happens when you call a method that doesn't exist. The
# following begin/rescue/end code block captures the exception and
# makes some assertions about it.
begin
nil.some_method_nil_doesnt_know_about
rescue Exception => ex
# What exception has been caught?
assert_equal NoMethodError, ex.class
# What message was attached to the exception?
# (HINT: replace __ with part of the error message.)
assert_match(/__/, ex.message)
end
конец
Я должен заменить __ на часть сообщения об ошибке, но мне это не удалось. Что ж, так и было, потому что после нескольких попыток я просто заменил его пробелом, поскольку решил, что в сообщении об ошибке есть пробелы между словами. Но как мне увидеть сообщение об ошибке?