Corrected test so that it checks for an exception.