require 'test/unit' require 'facet/fileutils/whereis' class TC_FileUtils_Whereis < Test::Unit::TestCase # Need a universal way to test. But how? # def setup # @workdir = Dir.getwd # @thisdir = File.dirname(__FILE__) # # # Change this to suit your system # @expected_locs = ['/usr/local/bin/ruby','/opt/sfw/bin/ruby', '/opt/bin/ruby'] # # # MS Windows - change as needed # if File::ALT_SEPARATOR # @expected_locs = ["c:\\ruby\\bin\\ruby.exe"] # end # end def test_method assert_respond_to( FileUtils, :whereis ) end # def test_whereis # Dir.chdir( @thisdir ) # assert_nothing_raised{ @locs = FileUtils.whereis("ruby") } # assert_nothing_raised{ FileUtils.whereis("ruby"){ |loc| } } # assert_equal(@expected_locs, @locs, "Not found where expected") # assert_equal(nil,FileUtils.whereis("blahblah")) # Dir.chdir( @workdir ) # end end