Test::Unit gives no errors on loading problems

Discussion in 'Ruby' started by Jim Weirich, May 9, 2004.

  1. Jim Weirich

    Jim Weirich Guest

    I'm rather surprised by the following result:

    $ cat x.rb
    require 'test/unit'
    requrie 'somethingelse'

    class TestIt < Test::Unit::TestCase
    def test_one
    assert_equal 1, 2
    end
    end

    $ ruby x.rb
    Loaded suite x
    Started

    Finished in 0.005333 seconds.

    0 tests, 0 assertions, 0 failures, 0 errors

    Although the 0 tests/0 assertions is a big clue something is wrong, I
    would have expected a little more helpful indication of error (e.g.
    Undefined method 'requrie') along with the file name and line number.

    It seems that test/unit is swallowing this information somehow/


    --
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     
    Jim Weirich, May 9, 2004
    #1
    1. Advertising

  2. On May 9, 2004, at 07:12, Jim Weirich wrote:

    > I'm rather surprised by the following result:
    >
    > $ cat x.rb
    > require 'test/unit'
    > requrie 'somethingelse'
    >
    > class TestIt < Test::Unit::TestCase
    > def test_one
    > assert_equal 1, 2
    > end
    > end
    >
    > $ ruby x.rb
    > Loaded suite x
    > Started
    >
    > Finished in 0.005333 seconds.
    >
    > 0 tests, 0 assertions, 0 failures, 0 errors
    >
    > Although the 0 tests/0 assertions is a big clue something is wrong, I
    > would have expected a little more helpful indication of error (e.g.
    > Undefined method 'requrie') along with the file name and line number.
    >
    > It seems that test/unit is swallowing this information somehow/


    What version of Ruby is this occurring in? I remember there being a bug
    that caused this a while back. Currently I receive the following:

    ntalbott@jacob:~/sandbox$ ruby -v t.rb
    ruby 1.9.0 (2004-04-14) [powerpc-darwin]
    t.rb:3: undefined method `requrie' for main:Object (NoMethodError)

    Which seems right to me.


    Nathaniel
    Terralien, Inc.

    <:((><
     
    Nathaniel Talbott, May 9, 2004
    #2
    1. Advertising

  3. Jim Weirich

    Jim Weirich Guest

    > On May 9, 2004, at 07:12, Jim Weirich wrote:
    >> It seems that test/unit is swallowing this information somehow/


    Nathaniel Talbott wrote:
    > What version of Ruby is this occurring in? I remember there being a bug
    > that caused this a while back.


    Oops, sorry. I had an old version of Test::Unit installed in the
    site_ruby directory. I clobbered that and everything is fine.

    I'm running the stable version of 1.8.1.

    --
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     
    Jim Weirich, May 9, 2004
    #3
    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. VvanN
    Replies:
    5
    Views:
    512
    Phlip
    Apr 28, 2006
  2. Bill David
    Replies:
    2
    Views:
    284
    Arne Vajhøj
    Jun 18, 2008
  3. Johan Holmberg
    Replies:
    7
    Views:
    183
    Johan Holmberg
    Sep 15, 2003
  4. Bill Mosteller
    Replies:
    0
    Views:
    249
    Bill Mosteller
    Oct 22, 2009
  5. timr
    Replies:
    2
    Views:
    179
Loading...

Share This Page