2009-06-30 20:26:46 -04:00
|
|
|
ORIG_ARGV = ARGV.dup
|
|
|
|
|
2009-09-01 11:05:17 -04:00
|
|
|
require 'rubygems'
|
|
|
|
gem 'rack', '~> 1.0.0'
|
|
|
|
gem 'rack-test', '~> 0.4.2'
|
|
|
|
|
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"
|
2009-06-26 20:32:05 -04:00
|
|
|
$:.unshift File.dirname(__FILE__) + "/../../activeresource/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'
|
2006-09-02 20:18:31 -04:00
|
|
|
require 'test/unit'
|
2009-02-03 21:25:37 -05:00
|
|
|
|
2007-03-01 18:29:56 -05:00
|
|
|
require 'active_support'
|
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
|