# Problems with Tests that fail and prettyprint

**URL:** <https://www.ruby-forum.com/t/problems-with-tests-that-fail-and-prettyprint/48436>\
**Category:** Ruby\
**Created:** [November 20, 2005, 4:44pm UTC](https://www.ruby-forum.com/t/problems-with-tests-that-fail-and-prettyprint/48436 "2005-11-20T16:44:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jsw](https://www.ruby-forum.com/u/jsw)\
**Post date:** [November 20, 2005, 4:44pm UTC](https://www.ruby-forum.com/t/problems-with-tests-that-fail-and-prettyprint/48436/1 "2005-11-20T16:44:26Z")

</div>

It may be an artifact of my installation (Ruby 1.8.2 on Windows) but  
when my  
tests fail, Ruby throws an excpetion in prettyprint. It doesn’t seem to  
what  
what the types of the values are when the assertion fails (strings,  
integer,  
or my own types), I always get the same exception and then prettyprinter  
is  
broken to the end of the entire testsuite.

Any suggestions?

Here’s the test results:

Loaded suite db2-test  
Started  
date result was 2005-1-2  
E…  
Finished in 1.187 seconds.

1. Error:  
test\_DB2\_date(TestDB2):  
TypeError: wrong argument type #Class:0x2b2fc38 (expected Data)  
C:/ruby/lib/ruby/1.8/prettyprint.rb:308  
C:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:18:in  
`require__' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in`require’  
C:/ruby/lib/ruby/1.8/pp.rb:149  
C:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:18:in  
`require__' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in`require’  
db2-test.rb:72:in `test\_DB2\_date’

6 tests, 24 assertions, 0 failures, 1 errors

and the test code:

require ‘dbi’  
require ‘test/unit’  
require ‘DB2V8\_Helper’

class TestDB2 \<Test::Unit::TestCase  
def test\_DB2\_date  
dbh = nil  
dbh = DBI.connect(‘dbi:DB2V8:sample’, ‘’, ‘’)  
stmt = dbh.prepare( “select date(‘2005-1-2’) from  
sysibm.sysdummy1”)  
stmt.execute  
row = stmt.fetch  
puts “date result was #{row[0]}”  
assert\_equal(row[0], ‘2005-1-2’, “wrong numeric value”)  
end

end
