test/cdiotest.rb in rbcdio-0.01 vs test/cdiotest.rb in rbcdio-0.02
- old
+ new
@@ -1,18 +1,23 @@
#!/usr/bin/env ruby
-# $Id: cdiotest.rb,v 1.13 2006/12/16 03:44:48 rocky Exp $
+# $Id: cdiotest.rb,v 1.14 2007/10/13 09:23:17 rocky Exp $
# Unit test for cdio
#
require "test/unit"
-Mypath = File.expand_path(File.dirname(__FILE__))
+unless defined?(Mypath)
+ Mypath = File.expand_path(File.dirname(__FILE__))
+end
old_dir = File.expand_path(Dir.pwd)
if old_dir != Mypath
Dir.chdir(Mypath)
end
-$: << Mypath + '/../ext/cdio'
-$: << Mypath + '/../lib'
+
+%w(/../ext/cdio /../lib).each do |src_dir|
+ $: << Mypath + src_dir unless $:.member?(src_dir)
+end
+
require "cdio"
class CdioTests < Test::Unit::TestCase
# Test running miscellaneous operations