Fix asserting the correct exception message in dependencies test

In Minitest, the second argument of assert_raise(s) accepts a string as
the message that should be shown in case of a failure in the assertion
(eg nothing was raised when it should), and not the exception message to
be matched.

To do that we need to save the exception returned from assert_raise(s)
into a local variable and check for the exception message using it.