Tests expected exception when no task is specified