aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/test_case.rb
blob: be38eb64a1dacf6d223926c67646ec22162ea397 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'active_support/testing/setup_and_teardown'
require 'active_support/testing/assertions'
require 'active_support/testing/declarative'

module ActiveSupport
  # Prefer MiniTest with Test::Unit compatibility.
  # Hacks around the test/unit autorun.
  begin
    require 'minitest/unit'
    MiniTest::Unit.disable_autorun
    require 'test/unit'

    class TestCase < ::Test::Unit::TestCase
      @@installed_at_exit = false
    end

  # Test::Unit compatibility.
  rescue LoadError
    require 'test/unit/testcase'
    require 'active_support/testing/default'

    class TestCase < ::Test::Unit::TestCase
      include ActiveSupport::Testing::Default
    end
  end

  class TestCase
    include ActiveSupport::Testing::SetupAndTeardown
    include ActiveSupport::Testing::Assertions
    extend ActiveSupport::Testing::Declarative
  end
end