abstract_unit.rb 1.1 KB
Newer Older
1 2
ORIG_ARGV = ARGV.dup

3
require 'active_support/core_ext/kernel/reporting'
4 5 6 7

silence_warnings do
  Encoding.default_internal = "UTF-8"
  Encoding.default_external = "UTF-8"
8 9
end

10
require 'active_support/testing/autorun'
11
require 'active_support/testing/method_call_assertions'
W
wycats 已提交
12

13
ENV['NO_RELOAD'] = '1'
14
require 'active_support'
15

16 17
Thread.abort_on_exception = true

18
# Show backtraces for deprecated behavior for quicker cleanup.
19
ActiveSupport::Deprecation.debug = true
20

21 22 23
# Default to old to_time behavior but allow running tests with new behavior
ActiveSupport.to_time_preserves_timezone = ENV['PRESERVE_TIMEZONES'] == '1'

24 25 26
# Disable available locale checks to avoid warnings running the test suite.
I18n.enforce_available_locales = false

27
# Skips the current run on Rubinius using Minitest::Assertions#skip
28 29 30
def rubinius_skip(message = '')
  skip message if RUBY_ENGINE == 'rbx'
end
31

32 33
# Skips the current run on JRuby using Minitest::Assertions#skip
def jruby_skip(message = '')
34
  skip message if defined?(JRUBY_VERSION)
35
end
36

37 38 39
class ActiveSupport::TestCase
  include ActiveSupport::Testing::MethodCallAssertions
end