remove duplication in output_to_stream shared examples