compass/test/test_helper.rb
Chris Eppstein b13fd43a2e Require relative to the load path instead of using the more convoluted approach of File.join(File.dirname(__FILE__), ...).
Also, don't ever muck with the load paths or rubygems without first
trying to require the library without doing so.
2009-09-02 21:45:08 -07:00

26 lines
688 B
Ruby

need_gems = false
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
$:.unshift(lib_dir) unless $:.include?(lib_dir)
# allows testing with edge Haml by creating a test/haml symlink
linked_haml = File.dirname(__FILE__) + '/haml'
if File.exists?(linked_haml) && !$:.include?(linked_haml + '/lib')
puts "[ using linked Haml ]"
$:.unshift linked_haml + '/lib'
require 'sass'
else
need_gems = true
end
require 'rubygems' if need_gems
require 'compass'
require 'test/unit'
require File.join(File.dirname(__FILE__), 'test_case_helper')
require File.join(File.dirname(__FILE__), 'io_helper')
require File.join(File.dirname(__FILE__), 'command_line_helper')