add real to_code method's tests to spec