1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add docs for AS::TestCase::test_order

Document `test_order` and `test_order=` from `ActiveSupport::TestCase`.

[ci skip]
This commit is contained in:
claudiob 2014-12-17 14:55:15 -08:00
parent 6d6f703012
commit 1d19a3a42a
2 changed files with 17 additions and 2 deletions

View file

@ -73,11 +73,11 @@ module ActiveSupport
@@test_order = nil
def self.test_order=(new_order)
def self.test_order=(new_order) # :nodoc:
@@test_order = new_order
end
def self.test_order
def self.test_order # :nodoc:
@@test_order
end
end

View file

@ -16,10 +16,25 @@ module ActiveSupport
Assertion = Minitest::Assertion
class << self
# 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+)
def test_order=(new_order)
ActiveSupport.test_order = new_order
end
# Returns the order in which test cases are run.
#
# ActiveSupport::TestCase.test_order # => :sorted
#
# Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+.
# Defaults to +:sorted+.
def test_order
test_order = ActiveSupport.test_order