Changed syntax so that tests occur on a yielded object instead of a returned one