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
|
|
|
|
|
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"
|
|
|
|
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
|
|
|
|
|
2015-06-11 12:18:33 -04:00
|
|
|
class ActiveSupport::TestCase
|
|
|
|
include ActiveSupport::Testing::MethodCallAssertions
|
2017-01-17 04:50:53 -05:00
|
|
|
|
|
|
|
# Skips the current run on Rubinius using Minitest::Assertions#skip
|
|
|
|
private def rubinius_skip(message = "")
|
|
|
|
skip message if RUBY_ENGINE == "rbx"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Skips the current run on JRuby using Minitest::Assertions#skip
|
|
|
|
private def jruby_skip(message = "")
|
|
|
|
skip message if defined?(JRUBY_VERSION)
|
|
|
|
end
|
2017-12-19 16:14:55 -05:00
|
|
|
|
|
|
|
def frozen_error_class
|
|
|
|
Object.const_defined?(:FrozenError) ? FrozenError : RuntimeError
|
|
|
|
end
|
2015-06-11 12:18:33 -04:00
|
|
|
end
|