aboutsummaryrefslogtreecommitdiffstats
path: root/test/testunit/tests_for_parallel/misc.rb
blob: f60b25d6c36d8c780e03b6891fb1ff2beae99579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# FIXME: more portability code
if caller(7) && /block in non_options/ =~ caller(7)[0]
  class TestCaseForParallelTest < Test::Unit::TestCase;end
else
  module Test
    module Unit
      class Worker
        def run_tests
          _run_anything :ptest
        end
      end
      class Runner
        def run_tests
          _run_anything :ptest
        end
      end
    end
  end
  module MiniTest
    class Unit
      class << TestCase
        alias ptest_suites test_suites
        def ptest_methods;[];end
      end
    end
  end

  class TestCaseForParallelTest < Test::Unit::TestCase
    class << self
      undef ptest_methods
      def ptest_methods
        public_instance_methods(true).grep(/^ptest/).map { |m| m.to_s }
      end
    end
  end
end