Yield the block if its given and returns its result when input expectation is failed