diff options
author | Xavier Noria <fxn@hashref.com> | 2013-02-24 01:12:45 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-02-24 01:12:49 +0100 |
commit | c15862ae0cb876d745609170f0f90a9bb9b5e0ae (patch) | |
tree | 226e86d66e6adcd998c61f9dff340047b388c279 | |
parent | c9c5656950533ab9223971da0aae7ffdf3cb40f8 (diff) | |
download | rails-c15862ae0cb876d745609170f0f90a9bb9b5e0ae.tar.gz rails-c15862ae0cb876d745609170f0f90a9bb9b5e0ae.tar.bz2 rails-c15862ae0cb876d745609170f0f90a9bb9b5e0ae.zip |
prevent minitest from printing a --seed run option
See the first FIXME comment in the patch for the rationale.
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 8b392c36d0..f4b162eafb 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -16,6 +16,16 @@ begin rescue LoadError end +# FIXME: We force sorted test order below, but minitest includes --seed SEED in +# the printed run options, which could be misleading, since users could assume +# from that trace that tests are being randomized. +MiniTest::Unit.class_eval do + alias original_help help + def help + original_help.sub(/--seed\s+\d+\s*/, '') + end +end + module ActiveSupport class TestCase < ::MiniTest::Unit::TestCase Assertion = MiniTest::Assertion @@ -26,8 +36,8 @@ module ActiveSupport yield if $tags[tag] end - # FIXME: we have tests that depend on run order, we should fix that and - # remove this method. + # FIXME: We have tests that depend on run order, we should fix that and + # remove this method (and remove the MiniTest::Unit help hack above). def self.test_order # :nodoc: :sorted end |