2009-02-03 21:57:01 -05:00
|
|
|
require 'rubygems'
|
2006-06-25 10:44:22 -04:00
|
|
|
require 'test/unit'
|
|
|
|
|
2009-02-03 21:25:37 -05:00
|
|
|
gem 'mocha', '>= 0.9.5'
|
|
|
|
require 'mocha'
|
|
|
|
|
2006-12-21 15:26:30 -05:00
|
|
|
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
2009-03-08 14:04:23 -04:00
|
|
|
$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
2006-12-21 15:26:30 -05:00
|
|
|
require 'active_resource'
|
|
|
|
require 'active_resource/http_mock'
|
2006-12-05 14:12:51 -05:00
|
|
|
|
2007-01-24 13:29:07 -05:00
|
|
|
$:.unshift "#{File.dirname(__FILE__)}/../test"
|
|
|
|
require 'setter_trap'
|
2007-01-23 00:22:33 -05:00
|
|
|
|
2008-04-16 06:39:19 -04:00
|
|
|
ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log")
|
|
|
|
|
2008-07-19 12:14:12 -04: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
|