Skip to content
This repository
Browse code

prevent minitest from printing a --seed run option

See the first FIXME comment in the patch for the rationale.
  • Loading branch information...
commit c15862ae0cb876d745609170f0f90a9bb9b5e0ae 1 parent c9c5656
Xavier Noria authored
14  activesupport/lib/active_support/test_case.rb
@@ -16,6 +16,16 @@
16 16
 rescue LoadError
17 17
 end
18 18
 
  19
+# FIXME: We force sorted test order below, but minitest includes --seed SEED in
  20
+# the printed run options, which could be misleading, since users could assume
  21
+# from that trace that tests are being randomized.
  22
+MiniTest::Unit.class_eval do
  23
+  alias original_help help
  24
+  def help
  25
+    original_help.sub(/--seed\s+\d+\s*/, '')
  26
+  end
  27
+end
  28
+
19 29
 module ActiveSupport
20 30
   class TestCase < ::MiniTest::Unit::TestCase
21 31
     Assertion = MiniTest::Assertion
@@ -26,8 +36,8 @@ def self.for_tag(tag)
26 36
       yield if $tags[tag]
27 37
     end
28 38
 
29  
-    # FIXME: we have tests that depend on run order, we should fix that and
30  
-    # remove this method.
  39
+    # FIXME: We have tests that depend on run order, we should fix that and
  40
+    # remove this method (and remove the MiniTest::Unit help hack above).
31 41
     def self.test_order # :nodoc:
32 42
       :sorted
33 43
     end

0 notes on commit c15862a

Please sign in to comment.
Something went wrong with that request. Please try again.