Hi,
I didn't find a way in RubyUnit to check both an exception and its error
message. Maybe its there somewhere. If not here's one version:
def assert_exception_and_message(exception, eMessage, message = "")
exception_raised = true
begin
yield
exception_raised = false
rescue Exception => e
raise e unless exception === e
assert_equals(eMessage, e.message)
end
assert(exception_raised, message)
end
Its not perfect but can easily be fixed. If something similar is not in
Lapidary I'd propose its added to the merged Test::Unit.
Regards,
Robert