2008/9/25 Dave Thomas <dave / pragprog.com>:
>
> On Sep 25, 2008, at 9:15 AM, Yusuke ENDOH wrote:
>
>> In addition, what do you think about pretty_print?
>>
>>  Expected <#<struct FooBarBaz
>>  foo=1,
>>  bar=2,
>>  baz=3>> not but <#<struct FooBarBaz
>>  foo=1,
>>  bar=2,
>>  baz=4>>
>>
>> I think this is much more ugly.
>
>
> Agreed, which is why I suggested the multiline format if the output doesn't
> fit on one line

Like this?

  Expected <#<struct FooBarBaz
   foo=1,
   bar=2,
   baz=3>>
  not but <#<struct FooBarBaz
   foo=1,
   bar=2,
   baz=4>>

I think below is better than above:

  <#<struct FooBarBaz
   foo=1,
   bar=2,
   baz=3>> expected but was
  <#<struct FooBarBaz
   foo=1,
   bar=2,
   baz=4>>

because all the lines heads of value are aligned.

But, well, it may be a matter of preference (though it also involves
compatibility problem with test/unit).  There is room for argument
about (3).

# So please apply (1) and (2) first :-)


> I don't think it adds
> much complexity--perhaps 5 lines of code?

(5 lines)  *  (the count of kind of assertions) ?

-- 
Yusuke ENDOH <mame / tsg.ne.jp>