Permalink
Browse files

+ Added TestCase.i_suck_and_my_tests_are_order_dependent!

[git-p4: depot-paths = "//src/minitest/dev/": change = 6554]
  • Loading branch information...
1 parent ddf2ae4 commit f1ceeaa634168e72a7a54b918fe7d3fa5594c89b @zenspider zenspider committed Aug 18, 2011
Showing with 12 additions and 6 deletions.
  1. +12 −6 lib/minitest/unit.rb
View
@@ -983,18 +983,24 @@ def self.reset # :nodoc:
reset
+ ##
+ # Call this at the top of your tests when you absolutely
+ # positively need to have ordered tests. In doing so, you're
+ # admitting that you suck and your tests are weak.
+
+ def self.i_suck_and_my_tests_are_order_dependent!
+ class << self
+ define_method :test_order do :alpha end
+ end
+ end
+
def self.inherited klass # :nodoc:
@@test_suites[klass] = true
klass.reset_setup_teardown_hooks
super
end
- ##
- # Defines test order and is subclassable. Defaults to :random
- # but can be overridden to return :alpha if your tests are order
- # dependent (read: weak).
-
- def self.test_order
+ def self.test_order # :nodoc:
:random
end

0 comments on commit f1ceeaa

Please sign in to comment.