move capture_io to spec helper