Resuable snip to put at the top of my tests

f=['..','lib']
until File.directory?(th=f.join('/'))
  raise 'cannot find lib directory' if File.expand(th) == '/lib'
  f.unshift('..')
end
$:.unshift(th)

Better ones?

T.

Well, I doubt you wanted this answer, but isn't this a lot cleaner?

$ ruby -I lib:test ts_all.rb

James Edward Gray II

···

On Sep 6, 2005, at 7:36 PM, Trans wrote:

f=['..','lib']
until File.directory?(th=f.join('/'))
  raise 'cannot find lib directory' if File.expand(th) == '/lib'
  f.unshift('..')
end
$:.unshift(th)

Better ones?