Class: ActiveSupport::TestCase

Inherits:
Minitest::Test
  • Object
show all
Extended by:
ActiveSupport::Testing::Declarative
Includes:
ActiveRecord::TestFixtures, ActiveSupport::Testing::Assertions, ActiveSupport::Testing::Deprecation, ActiveSupport::Testing::FileFixtures, ActiveSupport::Testing::SetupAndTeardown, ActiveSupport::Testing::TaggedLogging, ActiveSupport::Testing::TimeHelpers
Defined in:
activesupport/lib/active_support/test_case.rb,
railties/lib/rails/test_help.rb

Constant Summary collapse

Assertion =
Minitest::Assertion

Constants included from ActiveSupport::Testing::Assertions

ActiveSupport::Testing::Assertions::UNTRACKED

Class Method Summary collapse

Methods included from ActiveSupport::Testing::Declarative

test

Methods included from ActiveRecord::TestFixtures

#after_teardown, #before_setup, #enlist_fixture_connections, #run_in_transaction?, #setup_fixtures, #teardown_fixtures

Methods included from Concern

#append_features, #class_methods, extended, #included

Methods included from ActiveSupport::Testing::FileFixtures

#file_fixture

Methods included from ActiveSupport::Testing::TimeHelpers

#after_teardown, #freeze_time, #travel, #travel_back, #travel_to

Methods included from ActiveSupport::Testing::Deprecation

#assert_deprecated, #assert_not_deprecated, #collect_deprecations

Methods included from ActiveSupport::Testing::Assertions

#assert_changes, #assert_difference, #assert_no_changes, #assert_no_difference, #assert_not, #assert_nothing_raised

Methods included from ActiveSupport::Testing::SetupAndTeardown

#after_teardown, #before_setup

Methods included from ActiveSupport::Testing::TaggedLogging

#before_setup

Class Method Details

.test_orderObject

Returns the order in which test cases are run.

ActiveSupport::TestCase.test_order # => :random

Possible values are :random, :parallel, :alpha, :sorted. Defaults to :random.



40
41
42
# File 'activesupport/lib/active_support/test_case.rb', line 40

def test_order
  ActiveSupport.test_order ||= :random
end

.test_order=(new_order) ⇒ Object

Sets the order in which test cases are run.

ActiveSupport::TestCase.test_order = :random # => :random

Valid values are:

  • :random (to run tests in random order)

  • :parallel (to run tests in parallel)

  • :sorted (to run tests alphabetically by method name)

  • :alpha (equivalent to :sorted)



30
31
32
# File 'activesupport/lib/active_support/test_case.rb', line 30

def test_order=(new_order)
  ActiveSupport.test_order = new_order
end