2007-02-10 00:12:31 +01:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
|
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../actionpack/lib"
|
|
|
|
$:.unshift File.dirname(__FILE__) + "/../lib"
|
|
|
|
$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"
|
|
|
|
|
|
|
|
require 'test/unit'
|
2007-12-21 08:48:59 +01:00
|
|
|
require 'stringio'
|
|
|
|
require 'active_support'
|
2007-02-10 00:12:31 +01:00
|
|
|
|
2007-12-21 08:48:59 +01:00
|
|
|
# Wrap tests that use Mocha and skip if unavailable.
|
|
|
|
def uses_mocha(test_name)
|
|
|
|
require 'rubygems'
|
|
|
|
gem 'mocha', '>= 0.5.5'
|
|
|
|
require 'mocha'
|
|
|
|
yield
|
|
|
|
rescue LoadError
|
|
|
|
$stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
|
|
|
|
end
|
2007-02-10 00:12:31 +01:00
|
|
|
|
|
|
|
if defined?(RAILS_ROOT)
|
|
|
|
RAILS_ROOT.replace File.dirname(__FILE__)
|
|
|
|
else
|
|
|
|
RAILS_ROOT = File.dirname(__FILE__)
|
|
|
|
end
|