Eric Hodel wrote:

> I don't understand why I'm supposed to test a standard library I'm  
> using.  Usually I read the documentation and expect it to work that  
> way, but maybe I'm crazy.

Me either.  I thought Logger was your own code.  I agree that you 
shouldn't have to unit test a library that you trust.

If it's just Logger that's crap, then you can shrug and decide not to 
trust the library and respond accordingly.  But you're right, that Ruby 
allows other programmers to open a library you trust and bash it into 
untrustworthiness.  That's a real problem that should be considered.

Is the following legal unit test code?

def test_no_messing_with_trusted_libraries
    require 'logger'
    Logger.freeze
    assert_nothing_raised( require 'suspect_module', "Hey!  Somebody's 
mucking with the logger module!" )
end

You're right, you shouldn't HAVE to run that test.

-dB

-- 
David Brady
ruby_talk / shinybit.com
I'm feeling really surreal today... OR AM I?