problems with Tests that fail and prettyprint

Discussion in 'Ruby' started by JSW, Nov 20, 2005.

  1. JSW

    JSW Guest

    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
    JSW, Nov 20, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kj
    Replies:
    2
    Views:
    522
  2. Ed Baker
    Replies:
    5
    Views:
    114
    why the lucky stiff
    Sep 5, 2003
  3. Erik Terpstra

    How to use PrettyPrint?

    Erik Terpstra, Nov 11, 2004, in forum: Ruby
    Replies:
    1
    Views:
    93
    Alexey Verkhovsky
    Nov 11, 2004
  4. Hal Fulton

    prettyprint or pp questions

    Hal Fulton, Nov 25, 2004, in forum: Ruby
    Replies:
    3
    Views:
    495
    Hal Fulton
    Nov 26, 2004
  5. dayo
    Replies:
    11
    Views:
    326
    Ilya Zakharevich
    Dec 16, 2005
Loading...

Share This Page