Hi Are there any tools around that make rspec''s failure messages easier to read? unit_diff from ZenTest doesn''t seem to work - unless I missed something. A simple but very helpful improvement would be to use more line- breaks, e.g. Current output: expected "this is a very long string blah blah", got "this is a very very long string blah blah" (using ==) Easier to read: expected: "this is a very long string blah blah" got: "this is a very very long string blah blah" (using ==) Comments? Tom
On 6/22/07, Tom Locke <tom at hobocentral.net> wrote:> Hi > > Are there any tools around that make rspec''s failure messages easier > to read? > > unit_diff from ZenTest doesn''t seem to work - unless I missed something. > > A simple but very helpful improvement would be to use more line- > breaks, e.g. > > Current output: > > expected "this is a very long string blah blah", got "this is a very > very long string blah blah" (using ==) > > Easier to read: > > expected: > "this is a very long string blah blah" > got: > "this is a very very long string blah blah" > (using ==) > > Comments? >Try the --diff option. But I agree that we should consider breaking things up like you suggest anyway. What do others think? Aslak> Tom > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 6/22/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 6/22/07, Tom Locke <tom at hobocentral.net> wrote: > > Hi > > > > Are there any tools around that make rspec''s failure messages easier > > to read? > > > > unit_diff from ZenTest doesn''t seem to work - unless I missed something. > > > > A simple but very helpful improvement would be to use more line- > > breaks, e.g. > > > > Current output: > > > > expected "this is a very long string blah blah", got "this is a very > > very long string blah blah" (using ==) > > > > Easier to read: > > > > expected: > > "this is a very long string blah blah" > > got: > > "this is a very very long string blah blah" > > (using ==) > > > > Comments? > > > > Try the --diff option. But I agree that we should consider breaking > things up like you suggest anyway. > > What do others think?+1> > Aslak > > > Tom > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
El 22/6/2007, a las 14:36, Tom Locke escribi?:> Easier to read: > > expected: > "this is a very long string blah blah" > got: > "this is a very very long string blah blah" > (using ==) > > Comments?For me even easier to read would be: expected: "this is a very long string blah blah" got : "this is a very very long string blah blah" (using ==) I''m inclined to think that this formatting should only be employed for strings over a certain length. Really short strings wouldn''t benefit from it (eg. expected "foo", got "bar"). Cheers, Wincent
> For me even easier to read would be: > > expected: "this is a very long string blah blah" > got : "this is a very very long string blah blah" > (using ==)What about values with a very long inspect? It would be nice to include PP formatting, in which case you would want to either start on a new line, or I guess you could indent every line, but you do lose some horizontal space. Tom
I think it is a great idea. Noticeably better for long strings (and arrays), no worse for the short ones. +1 On 6/22/07, Wincent Colaiuta <win at wincent.com> wrote:> > El 22/6/2007, a las 14:36, Tom Locke escribi?: > > > Easier to read: > > > > expected: > > "this is a very long string blah blah" > > got: > > "this is a very very long string blah blah" > > (using ==) > > > > Comments? > > For me even easier to read would be: > > expected: "this is a very long string blah blah" > got : "this is a very very long string blah blah" > (using ==) > > I''m inclined to think that this formatting should only be employed > for strings over a certain length. Really short strings wouldn''t > benefit from it (eg. expected "foo", got "bar"). > > Cheers, > Wincent > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Scott Sehlhorst, President Tyner Blain LLC http://tynerblain.com/blog http://tynerblain.com/nexus -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070622/04c88870/attachment.html
On 6/22/07, Wincent Colaiuta <win at wincent.com> wrote:> El 22/6/2007, a las 14:36, Tom Locke escribi?: > > > Easier to read: > > > > expected: > > "this is a very long string blah blah" > > got: > > "this is a very very long string blah blah" > > (using ==) > > > > Comments? > > For me even easier to read would be: > > expected: "this is a very long string blah blah" > got : "this is a very very long string blah blah" > (using ==) > > I''m inclined to think that this formatting should only be employed > for strings over a certain length. Really short strings wouldn''t > benefit from it (eg. expected "foo", got "bar").Do we really want to try and make it that smart? What would that length be? I think this is asking for trouble.> > Cheers, > Wincent > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 6/22/07, Tom Locke <tom at hobocentral.net> wrote:> expected: > "this is a very long string blah blah" > got: > "this is a very very long string blah blah" > (using ==)How about the values indented? expected: "this is a very long string blah blah" got: "this is a very very long string blah blah" (using ==)
> How about the values indented? > > expected: > "this is a very long string blah blah" > got: > "this is a very very long string blah blah" > (using ==) >I like that style. better still with PP: PP.pp(value, " ").gsub("\n", "\n ") Tom
I like it. Also, I agree that it should be simple (at least for now), i.e., always use the format that you suggested instead of adding smarts about line length. That can come later if there''s enough support for it or patches are submitted. On 6/22/07, David Chelimsky <dchelimsky at gmail.com> wrote:> > On 6/22/07, Tom Locke <tom at hobocentral.net> wrote: > > expected: > > "this is a very long string blah blah" > > got: > > "this is a very very long string blah blah" > > (using ==) > > How about the values indented? > > expected: > "this is a very long string blah blah" > got: > "this is a very very long string blah blah" > (using ==)-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070622/182477dd/attachment.html
El 22/6/2007, a las 15:34, Wincent Colaiuta escribi?:> El 22/6/2007, a las 14:36, Tom Locke escribi?: > >> Easier to read: >> >> expected: >> "this is a very long string blah blah" >> got: >> "this is a very very long string blah blah" >> (using ==) >> >> Comments? > > For me even easier to read would be: > > expected: "this is a very long string blah blah" > got : "this is a very very long string blah blah" > (using ==)I''ve whipped up a patch for this against the current trunk (r2153). I was sick of seeing output like this: <http://pastie.textmate.org/76179> Now I see output like this: <http://pastie.textmate.org/76180> So for really short strings ("foo" vs "bar") readability is about the same, and for longer strings like the ones in the linked examples the readability is much improved. For *really* long strings (which wrap over multiple lines) readability in the console still sucks. You can see this for yourself by resizing your browser window to see how readability goes down as soon as wrapping starts to take place. But this is still a big improvement. If you run your specs from inside TextMate then even long strings are much more readable, because SpecMate doesn''t perform soft wrapping of long lines when showing diffs. Pasting the diff here: <http://pastie.textmate.org/76181> Will also try submitting via RubyForge, but I have a lot of troubling logging in thanks to the transparent proxy imposed by my ISP... :-( Cheers, Wincent
El 5/7/2007, a las 10:28, Wincent Colaiuta escribi?:> Pasting the diff here: > > <http://pastie.textmate.org/76181> > > Will also try submitting via RubyForge, but I have a lot of troubling > logging in thanks to the transparent proxy imposed by my ISP... :-(Managed to stay logged in long enough to get it submitted: <http://rubyforge.org/tracker/index.php? func=detail&aid=12010&group_id=797&atid=3151> Cheers, Wincent