From: pat eyler Date: 2005-05-04T06:45:53+09:00 Subject: Re: Typo-checking instead of static typing On 5/3/05, Eric Hodel wrote: > > PS: ZenTest comes, free of charge, with unit_diff, which is the > spiffiest test running helper tool ever. It runs your actual/expected > outputs through diff helping you spot the differences in massive > structures. Or even small ones of one or two lines. unit_test is awesome! Here's an example from an article I wrote recently (to be published soon) -- first without unit_test, then the same thing with unit_test. $ ruby ts_long.rb Loaded suite ts_long Started F Finished in 0.02506 seconds. 1) Failure: test_long(TestLong) [ts_long.rb:33]: <"If you use open source software, you're sure to brush up against some of its rough edges. It may be a bug, or a place where the documentation isn't clear (or doesn't exist), or maybe it's not available in your language.\n\nIf you want to give back to the community, you can work on any of these problems, even if you're not a programmer.\n\nYou could write a bug report for the developers (and submit a patch if you're a programmer).\n\nYou could write or extend existing documentation.\n\nIf you're really up for a challenge, you could even work on translating the application and/or documentation.\n\nHowever you choose to get involved, you should start by contacting the developers."> expected but was <"If you use open source software, you're sure to brush up against some of its rough edges. It may be a bug, or a place where the documentation isn't clear (or doesn't exist), or maybe it's not available in your language.\n\nIf you want to give back to the community you can work on any of these problems, even if you're not a programmer.\n\nYou could write a bug report for the developers (and submit a patch if you're a programmer).\n\nYou could write or extend existing documentation.\n\nIf you're really up for a challenge, you could even work on translating the application and/or documentation.\n\nHowever you choose to get involved, you should start by contacting the developers.">. 1 tests, 1 assertions, 1 failures, 0 errors $ ruby ts_long.rb | unit_diff.rb Loaded suite ts_long Started F Finished in 0.017676 seconds. 1) Failure: test_long(TestLong) [ts_long.rb:33]: 3c3 < If you want to give back to the community, you can work on any of these problems, even if you're not a programmer. --- > If you want to give back to the community you can work on any of these problems, even if you're not a programmer. 1 tests, 1 assertions, 1 failures, 0 errors $ > > -- > Eric Hodel - drbrain@segment7.net - http://segment7.net > FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 > > -- thanks, -pate ------------------------- We are often unable to tell people what they need to know, because they want to know something else, and would therefore only misunderstand what we said - the Raven (George MacDonald, Lilith)