2008-08-23 17:00:46 +00:00
|
|
|
# allows testing with edge Rails by creating a test/rails symlink
|
|
|
|
RAILS_ROOT = linked_rails = File.dirname(__FILE__) + '/rails'
|
|
|
|
RAILS_ENV = 'test'
|
|
|
|
|
|
|
|
need_gems = false
|
|
|
|
if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib')
|
|
|
|
puts "[ using linked Rails ]"
|
|
|
|
$:.unshift linked_rails + '/activesupport/lib'
|
|
|
|
$:.unshift linked_rails + '/actionpack/lib'
|
|
|
|
else
|
|
|
|
need_gems = true
|
|
|
|
end
|
|
|
|
|
|
|
|
# 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'
|
2009-05-07 17:24:32 +00:00
|
|
|
require 'sass'
|
2008-08-23 17:00:46 +00:00
|
|
|
else
|
|
|
|
need_gems = true
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'rubygems' if need_gems
|
|
|
|
|
|
|
|
require 'action_controller'
|
|
|
|
require 'action_view'
|
|
|
|
|
|
|
|
|
|
|
|
require 'test/unit'
|
2009-01-19 15:53:51 +00:00
|
|
|
|
|
|
|
module Compass
|
|
|
|
module TestCaseHelper
|
|
|
|
def absolutize(path)
|
|
|
|
if path.blank?
|
|
|
|
File.dirname(__FILE__)
|
|
|
|
elsif path[0] == ?/
|
|
|
|
"#{File.dirname(__FILE__)}#{path}"
|
|
|
|
else
|
|
|
|
"#{File.dirname(__FILE__)}/#{path}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|