2010-06-21 17:02:04 +00:00
|
|
|
ORIG_ARGV = ARGV.dup
|
|
|
|
|
2010-03-17 07:53:48 +00:00
|
|
|
begin
|
|
|
|
old, $VERBOSE = $VERBOSE, nil
|
|
|
|
require File.expand_path('../../../load_paths', __FILE__)
|
|
|
|
ensure
|
|
|
|
$VERBOSE = old
|
|
|
|
end
|
2009-11-10 04:56:49 +00:00
|
|
|
|
2010-03-01 00:16:57 +00:00
|
|
|
lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
|
|
|
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
|
|
|
|
|
2010-08-22 21:43:31 +00:00
|
|
|
require 'active_support/core_ext/kernel/reporting'
|
2010-08-22 05:23:13 +00:00
|
|
|
require 'active_support/core_ext/string/encoding'
|
2011-12-20 17:22:21 +00:00
|
|
|
|
|
|
|
silence_warnings do
|
|
|
|
Encoding.default_internal = "UTF-8"
|
|
|
|
Encoding.default_external = "UTF-8"
|
2010-08-22 05:23:13 +00:00
|
|
|
end
|
|
|
|
|
2012-01-06 23:18:12 +00:00
|
|
|
require 'minitest/autorun'
|
2010-03-30 23:53:44 +00:00
|
|
|
require 'empty_bool'
|
2010-03-17 07:53:48 +00:00
|
|
|
|
|
|
|
silence_warnings { require 'mocha' }
|
2009-09-14 05:41:04 +00:00
|
|
|
|
2009-03-27 02:10:13 +00:00
|
|
|
ENV['NO_RELOAD'] = '1'
|
2006-07-08 18:14:49 +00:00
|
|
|
require 'active_support'
|
2006-09-04 03:38:13 +00:00
|
|
|
|
2008-11-20 20:08:42 +00:00
|
|
|
def uses_memcached(test_name)
|
2009-09-25 01:36:40 +00:00
|
|
|
require 'memcache'
|
2009-03-29 06:55:43 +00:00
|
|
|
begin
|
2010-06-21 16:19:12 +00:00
|
|
|
MemCache.new('localhost:11211').stats
|
2009-03-29 06:55:43 +00:00
|
|
|
yield
|
|
|
|
rescue MemCache::MemCacheError
|
|
|
|
$stderr.puts "Skipping #{test_name} tests. Start memcached and try again."
|
|
|
|
end
|
2008-10-14 20:30:46 +00:00
|
|
|
end
|
|
|
|
|
2008-11-20 20:08:42 +00:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
2012-01-06 23:18:12 +00:00
|
|
|
ActiveSupport::Deprecation.debug = true
|