2017-07-09 08:06:36 -04:00
|
|
|
# frozen_string_literal: true
|
2017-07-10 09:39:13 -04:00
|
|
|
|
2010-06-21 13:02:04 -04:00
|
|
|
ORIG_ARGV = ARGV.dup
|
|
|
|
|
2018-09-29 20:50:43 -04:00
|
|
|
require "bundler/setup"
|
2016-08-06 12:03:25 -04:00
|
|
|
require "active_support/core_ext/kernel/reporting"
|
2011-12-20 12:22:21 -05:00
|
|
|
|
|
|
|
silence_warnings do
|
2017-01-11 03:48:00 -05:00
|
|
|
Encoding.default_internal = Encoding::UTF_8
|
|
|
|
Encoding.default_external = Encoding::UTF_8
|
2010-08-22 01:23:13 -04:00
|
|
|
end
|
|
|
|
|
2016-08-06 12:03:25 -04:00
|
|
|
require "active_support/testing/autorun"
|
2019-08-02 00:24:21 -04:00
|
|
|
require "active_support/testing/method_call_assertions"
|
2010-03-17 03:53:48 -04:00
|
|
|
|
2016-08-06 12:03:25 -04:00
|
|
|
ENV["NO_RELOAD"] = "1"
|
|
|
|
require "active_support"
|
2006-09-03 23:38:13 -04:00
|
|
|
|
2013-01-24 05:10:58 -05:00
|
|
|
Thread.abort_on_exception = true
|
|
|
|
|
2008-11-20 15:08:42 -05:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
2012-01-06 18:18:12 -05:00
|
|
|
ActiveSupport::Deprecation.debug = true
|
2013-08-21 11:07:33 -04:00
|
|
|
|
2016-04-28 02:59:32 -04:00
|
|
|
# Default to old to_time behavior but allow running tests with new behavior
|
2016-08-06 12:03:25 -04:00
|
|
|
ActiveSupport.to_time_preserves_timezone = ENV["PRESERVE_TIMEZONES"] == "1"
|
2016-04-28 02:59:32 -04:00
|
|
|
|
2013-12-16 13:04:07 -05:00
|
|
|
# Disable available locale checks to avoid warnings running the test suite.
|
|
|
|
I18n.enforce_available_locales = false
|
|
|
|
|
2019-08-02 00:24:11 -04:00
|
|
|
class ActiveSupport::TestCase
|
2021-01-25 14:50:41 -05:00
|
|
|
if Process.respond_to?(:fork) && !Gem.win_platform?
|
|
|
|
parallelize
|
|
|
|
else
|
|
|
|
parallelize(with: :threads)
|
|
|
|
end
|
2020-01-23 18:23:29 -05:00
|
|
|
|
2019-08-02 00:24:21 -04:00
|
|
|
include ActiveSupport::Testing::MethodCallAssertions
|
|
|
|
|
2019-08-02 00:24:11 -04:00
|
|
|
private
|
|
|
|
# Skips the current run on Rubinius using Minitest::Assertions#skip
|
|
|
|
def rubinius_skip(message = "")
|
|
|
|
skip message if RUBY_ENGINE == "rbx"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Skips the current run on JRuby using Minitest::Assertions#skip
|
|
|
|
def jruby_skip(message = "")
|
|
|
|
skip message if defined?(JRUBY_VERSION)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-03-24 13:59:28 -04:00
|
|
|
require_relative "../../tools/test_common"
|