aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorclaudiob <claudiob@gmail.com>2014-12-17 14:55:15 -0800
committerclaudiob <claudiob@gmail.com>2014-12-18 11:20:32 -0800
commit1d19a3a42a019f592e4bc7590cc24e179de1613c (patch)
tree110aaa5e95796336bbf8b73b0a257705e1f9c635 /activesupport/lib
parent6d6f70301209d2942288f60abb7d203e89e8d9b6 (diff)
downloadrails-1d19a3a42a019f592e4bc7590cc24e179de1613c.tar.gz
rails-1d19a3a42a019f592e4bc7590cc24e179de1613c.tar.bz2
rails-1d19a3a42a019f592e4bc7590cc24e179de1613c.zip
Add docs for AS::TestCase::test_order
Document `test_order` and `test_order=` from `ActiveSupport::TestCase`. [ci skip]
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support.rb4
-rw-r--r--activesupport/lib/active_support/test_case.rb15
2 files changed, 17 insertions, 2 deletions
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb
index 94468240a4..34040e9d33 100644
--- a/activesupport/lib/active_support.rb
+++ b/activesupport/lib/active_support.rb
@@ -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
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index a4ba5989b1..98b68455ab 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -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