Message from discussion
how should we handle long inspects in failure messages?
Received: by 10.142.199.12 with SMTP id w12mr2236876wff.68.1291491196681;
Sat, 04 Dec 2010 11:33:16 -0800 (PST)
X-BeenThere: wrong-rb@googlegroups.com
Received: by 10.142.2.41 with SMTP id 41ls16488390wfb.0.p; Sat, 04 Dec 2010
11:33:16 -0800 (PST)
Received: by 10.142.204.13 with SMTP id b13mr2206213wfg.67.1291491196433;
Sat, 04 Dec 2010 11:33:16 -0800 (PST)
Received: by 10.142.204.13 with SMTP id b13mr2206212wfg.67.1291491196418;
Sat, 04 Dec 2010 11:33:16 -0800 (PST)
Return-Path: <joelvanderw...@gmail.com>
Received: from mail-pw0-f50.google.com (mail-pw0-f50.google.com [209.85.160.50])
by gmr-mx.google.com with ESMTP id y8si3712840wfj.5.2010.12.04.11.33.15;
Sat, 04 Dec 2010 11:33:15 -0800 (PST)
Received-SPF: pass (google.com: domain of joelvanderw...@gmail.com designates 209.85.160.50 as permitted sender) client-ip=209.85.160.50;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joelvanderw...@gmail.com designates 209.85.160.50 as permitted sender) smtp.mail=joelvanderw...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by pwi4 with SMTP id 4so1879989pwi.9
for <wrong-rb@googlegroups.com>; Sat, 04 Dec 2010 11:33:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from
:user-agent:mime-version:to:subject:references:in-reply-to
:content-type:content-transfer-encoding;
bh=bU3CmPhg68Cua3LNcUzzZo5dHvv3VmCrXOts5WWcMI8=;
b=xkAicgaIN7TfRqOt6+UpXeC/mdZuJe2Ww9nVofC7oUg8RG1mbW6i9pAXQS8N3WDEg5
ua3X2t/yD0MNS4rNmMiL8Q/7gbFQlMD6JONstuycTl8AL8D68MPMPnCze8DvKjX68FdE
2Nm4EOTHT4ORY0/e3a96LQx5S6RM67bfv1N48=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
b=J00JrKlEvQW9+4QGldZEh5VlbaQbYKXjUbEyCEdTgEOrazG9u/fm5g+D38/qggh9o/
oOa3eL3SaaWLqum0U1PNO9GbxsY7wX1fQ54WGpn2rV+D5uvX2EipUnEEZ3cU2tVoX49r
vxHcnxwxu+rDE+Zpb5Ascr+9GCzfLWDi3aGzg=
Received: by 10.142.221.13 with SMTP id t13mr3408524wfg.56.1291491195314;
Sat, 04 Dec 2010 11:33:15 -0800 (PST)
Return-Path: <joelvanderw...@gmail.com>
Received: from [192.168.1.104] ([70.132.1.123])
by mx.google.com with ESMTPS id w14sm4356309wfd.18.2010.12.04.11.33.12
(version=TLSv1/SSLv3 cipher=RC4-MD5);
Sat, 04 Dec 2010 11:33:13 -0800 (PST)
Message-ID: <4CFA9776.9090...@gmail.com>
Date: Sat, 04 Dec 2010 11:33:10 -0800
From: Joel VanderWerf <joelvanderw...@gmail.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6
MIME-Version: 1.0
To: wrong-rb@googlegroups.com
Subject: Re: how should we handle long inspects in failure messages?
References: <AANLkTi=EBBGjR7RDMKDTpEvTvZWqKCdhe1EYux0-a...@mail.gmail.com>
In-Reply-To: <AANLkTi=EBBGjR7RDMKDTpEvTvZWqKCdhe1EYux0-a...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 12/04/2010 10:32 AM, Steve Conover wrote:
> Imagine an assert failure where inspecting an object in the assert
> spews three pages of stuff. What should we do about this, exactly?
brain-dead truncation?
As in my irbrc:
class IRB::Irb
def output_value
text =
if @context.inspect?
sprintf @context.return_format, @context.last_value.inspect
else
sprintf @context.return_format, @context.last_value
end
max = @context.max_output_size
if text.size < max
puts text
else
puts text[0..max-1] + "..." + text[-2..-1]
end
end
end