From: "Jesper Rønn-Jensen" Date: 2007-07-23T05:30:01+09:00 Subject: Re: "require" in unit test not returning true or false On Jul 22, 10:05 pm, Ryan Davis wrote: > Look... I'm a testing _freak_ and even I don't do this... > > First off, you dunno if you're using the REAL require or someone's > override. > > Second, you're not _actually_ testing require, so why bother? > > If you want to have a quick and easy way to determine that a project > has all the dependencies it needs, that seems better placed in the > project's rakefile or somesuch. Thanks Ryan, that will give me some leads to work on. Could you give an example on how you would do this in a project? I'm not sure I follow you on how to do it with a rakefile... One idea that comes to my mind is to new a class from the required library. That is actually testable and runs with no errors: def test_mechanize require 'mechanize' m = WWW::Mechanize.new actual = m.class.to_s assert_equal("WWW::Mechanize", actual) end Any comments on this? There is probably a better way... /Jesper R�nn-Jensen http://justaddwater.dk/