2006-09-02 20:18:31 -04:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
|
2009-02-25 05:36:10 -05:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../activerecord/lib"
|
2006-09-02 20:18:31 -04:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../actionpack/lib"
|
2009-02-25 17:01:44 -05:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../actionmailer/lib"
|
2006-09-02 20:18:31 -04:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../lib"
|
|
|
|
$:.unshift File.dirname(__FILE__) + "/../builtin/rails_info"
|
|
|
|
|
2009-02-03 21:25:37 -05:00
|
|
|
require 'stringio'
|
2008-11-23 17:48:36 -05:00
|
|
|
require 'rubygems'
|
2006-09-02 20:18:31 -04:00
|
|
|
require 'test/unit'
|
2009-02-03 21:25:37 -05:00
|
|
|
|
|
|
|
gem 'mocha', '>= 0.9.5'
|
2008-11-23 17:48:36 -05:00
|
|
|
require 'mocha'
|
2009-02-03 21:25:37 -05:00
|
|
|
|
2007-03-01 18:29:56 -05:00
|
|
|
require 'active_support'
|
2009-04-28 20:58:51 -04:00
|
|
|
require 'active_support/core/all'
|
2008-11-24 05:25:28 -05:00
|
|
|
require 'active_support/test_case'
|
2006-09-02 20:18:31 -04:00
|
|
|
|
2007-09-23 07:20:25 -04:00
|
|
|
if defined?(RAILS_ROOT)
|
|
|
|
RAILS_ROOT.replace File.dirname(__FILE__)
|
|
|
|
else
|
|
|
|
RAILS_ROOT = File.dirname(__FILE__)
|
2009-02-03 21:25:37 -05:00
|
|
|
end
|
2009-02-16 16:12:28 -05:00
|
|
|
|
|
|
|
def uses_gem(gem_name, test_name, version = '> 0')
|
|
|
|
gem gem_name.to_s, version
|
|
|
|
require gem_name.to_s
|
|
|
|
yield
|
|
|
|
rescue LoadError
|
|
|
|
$stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
|
2009-02-25 17:01:44 -05:00
|
|
|
end
|