2006-07-09 02:14:49 +08:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
2007-09-27 18:19:48 +08:00
|
|
|
$:.unshift File.dirname(__FILE__)
|
2006-07-09 02:14:49 +08:00
|
|
|
require 'active_support'
|
2006-09-04 11:38:13 +08:00
|
|
|
|
2007-09-16 05:39:04 +08:00
|
|
|
# Wrap tests that use Mocha and skip if unavailable.
|
2007-10-07 17:15:26 +08:00
|
|
|
unless defined? uses_mocha
|
|
|
|
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-09-16 05:39:04 +08:00
|
|
|
end
|
|
|
|
|
2006-09-04 11:38:13 +08:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
|
|
|
ActiveSupport::Deprecation.debug = true
|