From: "ara.t.howard" Date: 2009-03-30T07:33:18+09:00 Subject: Re: testy.rb - ruby testing that's mad at the world On Mar 29, 2009, at 2:09 PM, Phlip wrote: > Or even less: > > name = 42 > assert{ name == ultimate.answer } well, for one that won't run ;-) assert takes and arg and not a block... but that aside cfp:~ > cat a.rb require 'test/unit' class TC < Test::Unit::TestCase def test_with_shitty_error_reporting name = 42 assert name == 'forty-two' end end cfp:~ > ruby a.rb Loaded suite a Started F Finished in 0.007649 seconds. 1) Failure: test_with_shitty_error_reporting(TC) [a.rb:6]: is not true. 1 tests, 1 assertions, 1 failures, 0 errors the error message ' is not true', on 8th line of output (out of possibly thousands) makes me want to hunt the programmer down that wrote that club him to death with a 2x4. the assert api facilities insanity for the code maintainer now, in testy cfp:~/src/git/testy > ruby -I lib a.rb --- my lib: name compare: failure: expect: name: forty-two actual: name: 42 my thinking, currently, is that the test writer should be forced to . name the test suite . name the test . name the check because doing these three things allows for informative error reporting. testing just shouldn't facilitate obfusicating what went wrong - imho. cheers. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama