File: multi_test.rb

package info (click to toggle)
ruby-multi-test 0.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: ruby: 136; sh: 38; makefile: 7
file content (33 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (4)
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
require 'multi_test/assertion_library'
module MultiTest
  def self.disable_autorun
    if defined?(Test::Unit::Runner)
      Test::Unit::Runner.module_eval("@@stop_auto_run = true")
    end

    if defined?(Minitest)
      Minitest.instance_eval do
        def run(*)
          # propagate the exit code from cucumber or another runner
          case $!
          when SystemExit
            $!.status
          else
            true
          end
        end
      end

      if defined?(Minitest::Unit)
        Minitest::Unit.class_eval do
          def run(*)
          end
        end
      end
    end
  end

  def self.extend_with_best_assertion_library(object)
    AssertionLibrary.detect_best.extend_world(object)
  end
end