2009-02-28 02:23:00 +01:00
|
|
|
require 'rubygems'
|
2007-12-21 08:48:59 +01:00
|
|
|
require 'test/unit'
|
2009-08-04 17:16:03 +02:00
|
|
|
require 'active_support/test_case'
|
2009-02-28 02:23:00 +01:00
|
|
|
|
2010-05-25 19:45:45 +02:00
|
|
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
|
|
|
$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
|
2007-12-21 08:48:59 +01:00
|
|
|
require 'active_resource'
|
|
|
|
require 'active_resource/http_mock'
|
|
|
|
|
|
|
|
$:.unshift "#{File.dirname(__FILE__)}/../test"
|
|
|
|
require 'setter_trap'
|
|
|
|
|
2008-05-18 06:22:34 +02:00
|
|
|
ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log")
|
|
|
|
|
2008-09-07 07:54:05 +02: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."
|
|
|
|
end
|